Re: [squid-users] squid too many connections to cache_peers

From: Le Trung Kien <kienlt_at_vietnamnet.vn>
Date: Mon, 16 May 2011 13:55:13 +0700

Hi there,
Could this help ?

cache_peer <original_server_ip> parent <http_port> 0 no-query
originserver name=<any_name> max-conn=4000

Kien Le.

On Mon, May 16, 2011 at 1:34 PM, Or Gerson <OrG_at_websplanet.com> wrote:
> Thanks for the help,
>
> Just some clarification to understand the logic of squid: " Squid uses as many connections to each peer as there are
>  maximum parallel requests needing to go to that peer"
>
> how is it that squid has a lot less connections to each peer than the number of connections he opens to each peers?
> I mean he has 3 peers to divide the requests to. So I would have thought that the number of connections to each peer will
> Be roughly the number of connections to squid divided by 3.
>
> How is the maximum parallel requests needing to go to that peer is much higher than the number of connections to squid?
>
>
>
> Or Gerson
> IT Manager
>
> Mobile: 972-54-555-0656  Office: 972-3-769-8513
> E-mail: org@websplanet.com   Website: http://www.websplanet.com
>
>
>
>
> WebsPlanet, the leading provider of platforms for the mass production of websites
>
>
>
> -----Original Message-----
> From: Amos Jeffries [mailto:squid3_at_treenet.co.nz]
> Sent: Monday, May 16, 2011 3:29 AM
> To: squid-users_at_squid-cache.org
> Subject: Re: [squid-users] squid too many connections to cache_peers
>
>  On Sun, 15 May 2011 15:05:52 +0000, Or Gerson wrote:
>> Hello everyone,
>>
>> I have squid 3.0.STABLE19-1 installed.
>> And 3 apache cache_peers.
>>
>> I find that squid is opening a lot of connections to the web servers
>> a lot more than the connections he is receiving from clients, also
>> squid doesn't close them and they are in TIME_WAIT status.
>> For example: in squid I see 324 TIME_WAIT connections
>> On each server I see around 800 TIME_WAIT connections
>
>  TIME_WAIT is a closing connection.
>  ESTABLISHED is an open connection.
>
>  This explains:
>  http://www.developerweb.net/forum/showthread.php?t=2941
>
>
>>
>> The cache_peers are configured with round-robin, but why squid
>> doesn't closes the connections?
>>
>> Can't squid use one connection for each peer and send and receive all
>> requests through that connection (although that probably will cause
>> performance problems in the apache side because he won't uses all
>> apache server processes)?
>
>  One connection to each is indeed a performance bottleneck. Pipelining
>  is also not safe for HTTP/1.0 software (ie Squid 3.0 and older) without
>  great risk of breakage (just ask Debian people about apt-get corruption
>  problems). Squid uses as many connections to each peer as there are
>  maximum parallel requests needing to go to that peer. Enable
>  server_persistent_connections to servers and Squid will re-use
>  connections as much as possible given the HTTP support version.
>
>  An upgrade to 3.1 series Squid will get you HTTP/1.1 connections to
>  servers and peers. This gives a lot better re-use of the connections
>  than HTTP/1.0 connection support in 3.0 series can. Provided Apache
>  plays along and uses HTTP/1.1 features to prevent early TCP link
>  closure.
>
>  Amos
>
> This message, together with its attachments, contains information from
> WebsPlanet Ltd., which is privileged and confidential.
> If you are not the intended recipient or you have received this message in
> error, then please notify us immediately by e-mail to info_at_websplanet.com,
> and delete all copies of this message and its attachments.
>
Received on Mon May 16 2011 - 06:55:20 MDT

This archive was generated by hypermail 2.2.0 : Mon May 16 2011 - 12:00:02 MDT