[Dnsmasq-discuss] [PATCH] Retry queries only after giving the upstream server some time to respond
dl6er at dl6er.de
Mon Apr 5 15:46:36 UTC 2021
I've seeing a notable increase in upstream traffic with the current
dnsmasq release candidate. Some investigations have revealed that the
reason for this is the modified forwarding philosophy that *always*
triggers a retry whenever a query is received before the upstream was
able to answer (which may take long on slow networks).
This patch adds a timeout to stop such forward destination flooding.
Before the timeout is reached, identical queries are just put on the
list form where they will get replied to when the response to the first
forwarded query arrives. The difference added by the patch is that such
queries do not trigger another forwarding within the configured
If we still received nothing, the next query *after* the timeout is
again forwarded to avoid hanging because the original query got lost.
Th default for this interval is 3 seconds, it can be changed using a
setting and even be disabled (by setting to zero) which restores the
behavior we have right now. The default of 3 seconds has been chosen
such that we will retry when other software considers this a good idea
(retry timeout is 5 seconds in Linux, see RES_TIMEOUT in <resolv.h>).
I confirmed the intended effect in my local tests: Reduced unnecessary
forwarding traffic without the danger of failing when the first query
is lost (or whatever).
Let me know if you need something more/else. It should be easy to
review this one.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6316 bytes
Desc: not available
More information about the Dnsmasq-discuss