-
Notifications
You must be signed in to change notification settings - Fork 36
TASK-91082: Announce dnsbuf module deprecation
#807
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
Changes from 1 commit
ec456ba
3032eb9
1577ea9
e8e1b9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| lastUpdated: "09/30/2020" | ||
| title: "dnsbuf – Configure the DNS UDP Buffer Sizes" | ||
| description: "Configuration Change This feature is available in Momentum 4 8 and later" | ||
| --- | ||
|
|
||
| <a name="idp21140416"></a> | ||
|
|
||
| **Configuration Change.** This feature is available in Momentum 4.8 and later. | ||
|
|
||
| Momentum does not manipulate the size of UDP sockets it creates and uses for DNS queries; instead, it will use the default sizes configured by the Operating System. This can create problems for clients with too many domains (e.g., tens of thousands) in the system. Responses may be dropped, causing unnecessary DNS failures and retries, thus further increasing the DNS query volume. The `dnsbuf` module enables the client to configure the DNS buffer sizes at the service startup. | ||
|
|
||
| ### <a name="modules.dnsbuf.configuration"></a> Configuration | ||
|
|
||
| The `dnsbuf` module is configured as follows: | ||
|
|
||
| <a name="example.dnsbuf"></a> | ||
|
|
||
| ``` | ||
| dnsbuf { | ||
| sndbuf_size = "65536" # Default value is 131072 | ||
| rcvbuf_size = "65536" # Default value is 131072 | ||
| } | ||
| ``` | ||
|
|
||
| <dl class="variablelist"> | ||
|
|
||
| <dt>sndbuf_size</dt> | ||
|
|
||
| <dd> | ||
|
|
||
| The SO_SNDBUF value is set to this value for all UDP DNS sockets. Minimum value is 1024\. Note that in Linux the value in the kernel is automatically doubled; e.g., when a value of 65536 is configured in the module, the kernel will implement a buffer size of 131072. | ||
kkelley1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| </dd> | ||
|
|
||
| <dt>rcvbuf_size</dt> | ||
|
|
||
| <dd> | ||
|
|
||
| The SO_RCVBUF value is set to this value for all UDP DNS sockets. Minimum value is 1024\. Note that in Linux the value in the kernel is automatically doubled; e.g., when a value of 65536 is configured in the module, the kernel will actually implement a buffer size of 131072. | ||
|
|
||
| </dd> | ||
|
|
||
| </dl> | ||
|
|
||
| ### <a name="modules.dnsbuf.subtleties"></a> Subtleties | ||
|
|
||
|
|
||
| * Changes in the values require a service restart to take effect. They are *not* applied in a configuration reload. | ||
| * The buffer cannot be set beyond the **sysctl**-defined maximums in Linux: | ||
|
|
||
| ``` | ||
| net.core.rmem_max | ||
| net.core.wmem_max | ||
| ``` | ||
|
|
||
| Note that those values are the post-doubled values; e.g., if `net.core.wmem_max` is set to 65536, the maximum value that will work in the `dnsbuf` module is `sndbuf_max` = 32768. | ||
|
|
||
| ### <a name="modules.dnsbuf.dropped"></a> Determining that DNS Responses are Being Dropped | ||
|
|
||
| To determine whether the DNS responses are being dropped because the DNS UDP socket buffer is full, look for a corresponding increase in the "Pending DNS Queries" statistic from Momentum and the UDP packet errors from netstat, e.g.: | ||
|
|
||
| ``` | ||
| while sleep 1; do (netstat --udp -s | grep error; echo summary | | ||
| /opt/msys/ecelerity/bin/ec_console | grep DNS); echo; done | ||
kkelley1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| The following is an example in which Momentum started with ~30,000 unresolvable domains in the queue. Notice that the "packet receive errors" number has increased, and there are a high number of pending DNS queries. | ||
|
||
|
|
||
| ``` | ||
| 1559857 packet receive errors | ||
| DNS A Queries: 924801 | ||
| DNS AAAA Queries: 0 | ||
| DNS MX Queries: 907577 | ||
| Pending DNS Queries: 312 | ||
|
|
||
| 1559857 packet receive errors | ||
| DNS A Queries: 924803 | ||
| DNS AAAA Queries: 0 | ||
| DNS MX Queries: 907849 | ||
| Pending DNS Queries: 43 | ||
|
|
||
| 1560125 packet receive errors | ||
| DNS A Queries: 924803 | ||
| DNS AAAA Queries: 0 | ||
| DNS MX Queries: 908388 | ||
| Pending DNS Queries: 311 | ||
| ``` | ||
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.
Do we still have
dnsbufmodule? I thought we moved the config options to global.And this options only work for ARES resolver, right? I don't see it's called out here.
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.
The
dnsbufmodule was retained for back compatibility, but you can see in the source code PR that it changes the new global configuration behind the scenes.And yes, this is only applicable for ARES (indeed, it always was, even in the 4.7 version and older ones).
Uh oh!
There was an error while loading. Please reload this page.
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.
So the config option defined in the module will be actually taken for the global? Why is it? We don't normally do it.
I would prefer to remove them from the
dnsbufmodule and only keep it as global.Uh oh!
There was an error while loading. Please reload this page.
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.
The original implementation of
dnsbufrelied on the UDP sockets that Momentum created for ARES in the glue logic with the imported library, so the changes in the options could be set at runtime, e.g., with a reload of the configuration.Now the UDP buffers for the sockets created internally by ARES need to be configured at the library instantiation, i.e., during
eceleritystartup. I looked for an example in the source where the core searches for and reads the options of an instantiated module to be applied during startup; however, I think that this is not possible with the current support of the modules API.If we replace the
dnsbufoptions with the global options, we'll break the configuration of customers that use that module.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.
dnsbufhas no need to exist any more, customers using it right now will fail to start Momentum and a one time fix to move the configuration to global will fix it. I'd like to go this route. Not mentioning that it's very unlikelydnsbufis actually in use.