Re: [squid-users] Connection pooling backend servers

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 01 May 2013 13:01:05 +1200

On 1/05/2013 1:40 a.m., Roy Reznik wrote:
> Is there some way to maintain a connection pool to backend servers?
> I tried using this:
> http_port 3128 accel vhost protocol=https tcpkeepalive=60

This is the control for client-to-Squid connections. The tcpkeepalive
only affects the interval between packets. HTTP messaging and flow
control is on a whole different level.

> When I try looking at it using tshark, I can see that for every
> request an SSL handshake is made between squid and the back-end
> server.
>
> Thanks,
> Roy.

In HTTP this is called persistent connections (pconn, or sometimes
"keep-alive" after the header labeling).

For ideal performance you enable persistent connections to both servers
and clients.
  http://master.squid-cache.org/Doc/config/server_persistent_connections/
  http://master.squid-cache.org/Doc/config/client_persistent_connections/

With a couple of caveats:
  * Both ends of the connection need to support and be using the feature
for this to work.
  * It only works on *most* transaction types. There are some such as
CONNECT where the request transaction can only be completed by
terminating the TCP connection itself - persistence cannot help when one
of these goes through.
  * HTTP/1.0 clients for dynamic websites (very popular) often make use
of the unknown-length response tyes which fall into the category of
transactions above. So persistence with them is often not much use or
not showing much gain.

Other that those caveats it works well. We have been improving the
support for connection persistence across the last few versions of
Squid, so the more recent version you can run the better it will work.

Amos
Received on Wed May 01 2013 - 01:01:11 MDT

This archive was generated by hypermail 2.2.0 : Wed May 01 2013 - 12:00:48 MDT