Draft
Conversation
ed05740 to
8c1f711
Compare
…ause ReadHeaderTimeoutServer and ReadTimeoutServer are not the right timeouts to use for a tcp queuerefactor: create metrics.NoMetrics to not have to check for nil accessing metrics.Metrics, this might be even an optimization because of omitting branches and compiler can likely figure out that we call an empty body function test: add good coverage for StackListener and a benchmark benchmark: stackListner and queueListener Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
…tions Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
8c1f711 to
ad4fe67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal is to simplify the code and use a simple stack data structure with a mutex instead of multiple chains of calls through channels, which all have a lock. We observed in lifo() filters that there is lock contention on high load that reduces linear scalability by number of cores on a single machine.
Here we use 2 goroutines for the TCP accept handler. One that accepts and push on stack and the other that is a throttled hot loop that does stack pop() and sends it to our internal Accept() via channel.