Re: [squid-users] Squid intermittently fails with 503 after connect

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 20 Sep 2013 15:19:15 +1200

On 19/09/2013 1:29 a.m., John McGowan wrote:
> On Wed, Sep 18, 2013 at 7:41 AM, Alfredo Rezinovsky
> <alfredo_at_fing.uncu.edu.ar> wrote:
>> El 16/09/13 18:35, John McGowan escribió:
>> squid defaults connect_retries to 0
>> try setting it to something and see if the 503 errors frequency are lower
>> with this.
>>
> I remember looking at that configuration parameter, but there were two
> things that stopped me from working with it.
>
> 1) I believe it's only available in squid 3, and I'm using squid 2.X
> (what's available via yum from CentOS 5.X)
>
> 2) This line from the documentation...
>
> This sets the maximum number of connection attempts made for each
> TCP connection. The connect_retries attempts must all still
> complete within the connection timeout period.
>
> I may be reading this wrong, but in my situation, if I had a low
> timeout, it seems like it wouldn't do any good to increase
> connect_retries, since the first connect attempt is likely to use up
> the complete timeout period available.

Correct. That timout covering the whole TCP setup process from DNS
reolution through to multiple retries is one of the design flaws of 2.x
and early 3.x. This has now been fixed in 3.2+ where that timeout only
covers a single TCP connection attempt (forward_timeout still covers the
whole process, with configurable retries and separate dns_timeout).

The operation and timeout nesting looks something like this:
in 2.x:
  forward_timeout = forward_retries * connect_timeout
   connect_timeout = connect_retries * (dns_timeout + m * TCP connects)

in 3.2+:
  forward_timeout = peer selection + dns_timeout + forward_max_retries *
(connect_retries * connect_timeout).

Amos
Received on Fri Sep 20 2013 - 03:19:18 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 20 2013 - 12:00:05 MDT