dnsdist: Add an option to use several source ports toward a backend #6317
Conversation
pdns/dnsdist-lua.cc
Outdated
@@ -216,6 +217,10 @@ void setupLuaConfig(bool client) | |||
} | |||
} | |||
|
|||
if(vars.count("sockets")) { | |||
numberOfSockets=std::stoi(boost::get<string>(vars["sockets"])); |
zeha
Mar 1, 2018
Collaborator
maybe add a check > 0
maybe add a check > 0
Added a check that the number of sockets is greater than 0, handle more gracefully a failed (re-)connection, and updated the file descriptors check to account for more than one socket per backend. |
Note that the current implementation will not perform well with a large number of sockets per backend since it currently uses
|
This is very useful if the backend is distributing queries based only on (source IP, source port, destination IP, destination port), which is for example the case of PowerDNS Recursor with several threads, reuseport set and pdns-distribute-queries not set.
Pushed an additional commit using our existing multiplexer code. I went with the second option described above, adding a new function to the multiplexer interface that returns a list of 'ready' file descriptors. This code needs a serious review before merging! |
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
This is very useful if the backend is distributing queries based only on (source IP, source port, destination IP, destination port), which is for example the case of PowerDNS Recursor with several
threads,
reuseport
set andpdns-distribute-queries
not set.Checklist
I have: