-
Notifications
You must be signed in to change notification settings - Fork 974
dnsdist: Add a function to set the UDP recv/snd buffer sizes #11008
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: Add a function to set the UDP recv/snd buffer sizes #11008
Conversation
And raise them to 16777216 by default.
pdns/pdns_recursor.cc
Outdated
|
|
||
| setSocketReceiveBuffer(fd, 250000); | ||
| try { | ||
| setSocketReceiveBuffer(fd, 25000); |
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.
is this value supposed to change from before?
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.
Not at all, thanks a lot!
omoerbeek
left a comment
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.
A nit for the OpenBSD case.
pdns/dnsdist.cc
Outdated
| bool g_truncateTC{false}; | ||
| bool g_fixupCase{false}; | ||
| bool g_dropEmptyQueries{false}; | ||
| uint32_t g_socketUDPSendBuffer{16777216}; |
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.
This is quite greedy, on OpenBSD:
Unable to raise socket buffer size to 16777216: No buffer space available
Unable to raise socket buffer size to 16777216: No buffer space available
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.
Right, I was afraid of something like that. I now see that the default on Linux is likely smaller than that on most distributions (212992 on x86_64, 163840 on 32 bits). So I see three options:
- a smaller default value, like the recursor does, perhaps 160k?
- default value of 0 so we keep the system default
- default value of 0 except for Linux, where we set something like 200k?
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.
250000 works on OpenBSD. so a default of that (or smaller) for dnsdist would work for me
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.
On all Linux distributions I checked, rmem_default == rmem_max and wmem_default == wmem_max by default, so we would not be able to raise the value. So I guess doing nothing by default makes more sense, and the administrator can set higher values if needed.
|
The failing recursor regression tests seem to fail to start the auth... ?? |
@check-spelling-bot ReportUnrecognized words, please review:
To accept these unrecognized words as correct, run the following commands... in a clone of the git@github.com:rgacogne/pdns.git repository If the flagged items do not appear to be textIf items relate to a ...
|
omoerbeek
left a comment
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.
Now wondering why rec only sets the receive buffer size and not the send buffer size. A peak in incoming request normally also leaks to a peak in replies I would say. But that's a different issue.
Agreed. The good news is that raising |
Short description
And raise them to 16777216 by default. Although perhaps we should only do that on Linux?
This PR also refactors the functions duplicated in the recursor, calidns and dnsreplay and therefore impacts the auth and the rec.
Closes #10898.
Checklist
I have: