dnsdist: Add setTCPUseSinglePipe()
to use a single TCP waiting queue
#4817
Conversation
Some small comments, but overal looks good. I'm curious how well a single pipe works when reading from it from multiple threads. |
pdns/dnsdist.hh
Outdated
public: | ||
|
||
TCPClientCollection(size_t maxThreads) | ||
TCPClientCollection(size_t maxThreads, bool useSinglePipe=false): d_maxthreads(maxThreads), d_useSinglePipe(useSinglePipe) | ||
{ | ||
d_maxthreads = maxThreads; |
RobinGeuze
Dec 29, 2016
Contributor
Bit pointless to leave this here with the constructor initialisation list in place.
Bit pointless to leave this here with the constructor initialisation list in place.
pdns/dnsdist.hh
Outdated
} | ||
} | ||
else { | ||
d_singlePipe[0] = -1; |
RobinGeuze
Dec 29, 2016
Contributor
Might be more consistent to preinitialize d_singlePipe to -1 for both, in that case you can do away with this else.
Might be more consistent to preinitialize d_singlePipe to -1 for both, in that case you can do away with this else.
9262b65
to
2ec61e4
By default, every TCP worker thread has its own queue, and incoming TCP connections are dispatched to TCP workers on a round-robin basis. This might cause issues if some connections are taking a very long time, since incoming ones will be waiting until the TCP worker they have been assigned to has finished handling its current query, while other TCP workers might be available. This experimental `setTCPUseSinglePipe(true)` directive can be used so that all the incoming TCP connections are put into a single queue and handled by the first TCP worker available.
2ec61e4
to
b79e499
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.
Short description
By default, every TCP worker thread has its own queue, and incoming TCP connections are dispatched to TCP workers on a round-robin basis.
This might cause issues if some connections are taking a very long time, since incoming ones will be waiting until the TCP worker they have been assigned to has finished handling its current query, while other TCP workers might be available.
This experimental
setTCPUseSinglePipe(true)
directive can be used so that all the incoming TCP connections are put into a single queue and handled by thefirst TCP worker available.Checklist
I have: