Re: dns_timeout and dns_retransmit_interval in ms

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 15 Mar 2011 12:25:41 +1300

 On Mon, 14 Mar 2011 10:35:30 -0600, Alex Rousskov wrote:
> On 03/12/2011 02:00 PM, Tsantilas Christos wrote:
>> Convert dns_timeout and dns_retransmit_interval configuration
>> options to
>> use millisecond resolution.
>>
>> One second resolution is too coarse for small timeouts in
>> delay-sensitive environments, especially when a retransmit, bypass,
>> or
>> another corrective action is available and is likely to produce a
>> positive outcome. In DNS world specifically, most timeouts are
>> measured
>> in milliseconds.
>
>> +static void
>> +dump_time_msec(StoreEntry * entry, const char *name, uint64_t var)
>> +{
>> + storeAppendPrintf(entry, "%s %d seconds and %d milliseconds\n",
>> name, (int) (var/1000), (int) (var % 1000));
>> +}
>
> I doubt we are consistent with this everywhere, but should we try to
> dump options in a format compatible with squid.conf syntax? If yes,
> we
> could do something like this (at least):

 Yes. We MUST even. People use the cachemgr output these dump routines
 flow into as copy-n-paste sources for other squid.conf and tutorials.

>
> if (var % 1000)
> storeAppendPrintf(entry, "%s %d milliseconds\n", name, (int)
> var);
> else
> storeAppendPrintf(entry, "%s %d seconds\n", name, (int)
> (var/1000));

 Please also avoid the 32-bit cast by using %"PRIu64" for all unsigned
 64-bit display.

 Also, conversion to the largest whole time period (second, minute,
 hour, day etc as supported by the parser) would be good for user
 education through the display defaults.

 Amos
Received on Mon Mar 14 2011 - 23:25:46 MDT

This archive was generated by hypermail 2.2.0 : Tue Mar 15 2011 - 12:00:03 MDT