Subject: randomize retry timeouts

randomize retry timeouts

From: Phil Blundell <pb_at_reciva.com>
Date: Sun, 11 Jan 2009 13:29:03 +0000

This patch adds some pseudo-random variance to the retry timers used for
c-ares requests.

Again, this was motivated by a bad experience with the internal DNS
servers in ADSL router boxes: it seems that some of these will start
dropping requests very quickly if they receive more than a couple of
queries within a short time. In our case, our application was sending
off a handful of requests almost simultaneously, which overwhelmed the
router and caused almost all of them to time out. But, since the retry
time was constant for all the channels, all the retries were then
transmitted simultaneously as well, causing the same thing to happen
again and again. Allowing c-ares to vary the exact point at which the
retransmission is sent causes the retries to end up more evenly
distributed, rather than being clumped, and reduces the chance of this
problem occurring.

p.

Received on 2009-01-11