New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsdist: Implement TCP out-of-order #9582
Conversation
How many TCP connections did you simulate during your 6kqps test? |
Very good! Did you test with real DNS queries or with synthetic? If I test with real DNS traffic, the response rate is below 60% |
Yes, that test is done with the data set mentioned in #9572, which is real-word traffic. Note that the test is done over DNS over TLS, and I tuned a few things:
On the recursor side, both #9495 and #9572 are applied, and I have:
|
Is this meant as unlimited? Because "Setting this value to 0 disables stored session entirely" |
No, it is intended to disable sessions stored server-side, since client-side tickets are much nicer to the server and more realistic in anycast setups anyway, since the session-ticket key can be shared between servers much more easily than the server-side sessions. |
68e8d17
to
d14dd3f
Compare
d14dd3f
to
65c87b4
Compare
Squashed to clean up the history a bit, and to make sure all commits build and pass the unit tests. |
It turns out that collisions do happen with a random ID.
Altering an existing state instead of removing then adding it back saves a call to `epoll_ctl()`.
It usually works and saves adding the descriptor to the set, calling epoll_wait() then removing the descriptor.
65c87b4
to
8904f4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite a big PR, so I won't state I looked at every line of code. But what I checked looks good and basic testing show it works as advertised once I git the settings right.
related to that: please document that for it to work you should set both incoming and outgoing maxInFlight
.
I did not expect you to look at every single detail, don't worry! :-) Thanks a lot for the review and tests!
I just added more words on how that feature works, that was clearly lacking! |
Short description
This PR implements TCP out-of-order support for dnsdist:
We try to reuse the existing TCP connections as much as possible, but we might need to open many connections to the same backend, especially if that backend does not support out-of-order. We also don't mix queries from different incoming TCP connections on the same TCP connection to the backend, since that would require taking care of query ID collisions, which we currently detect. An existing TCP connection to the backend can be re-used for a different incoming connection later, though.
This PR break the TCP handling code in two parts, one handling incoming TCP connections and a second one handling outgoing ones.
It still needs a serious review and more testing.
DNS Shotgun seems to be quite happier with it, by the way:


Checklist
I have: