Re: [squid-users] Setting SO_KEEPALIVE on outbound connections

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 28 Jan 2014 13:33:31 +1300

On 2014-01-28 08:33, eam wrote:
> Hi all,
>
> I have a squid cache behind a stateful network device which drops idle
> TCP
> connections after 300 seconds. I need to ensure TCP level keepalives
> are
> set both for traffic to squid (accept) as well as traffic from squid
> (connect) in order to support long-lived connections with idle periods.
>
> I've found the "http_port keepalive" option, which does set
> SO_KEEPALIVE
> on the accept end of squid. But this directive doesn't set keepalives
> for
> outbound traffic, which I need as well.
>
> Would squid folks be receptive to a patch that adds a toplevel config
> directive to set SO_KEEPALIVE on all connections, both inbound and
> outbound? Or have I overlooked something and is this possible today?
> I'm
> relatively unfamiliar with Squid and am just starting to paw through
> the
> source to see what achieving this would take.

We do not have anything configurable today doing this.

Patches are welcome on the squid-dev mailing list, please see the patch
submission requirements at http://wiki.squid-cache.org/MergeProcedure

Your patch should probably call commSetTcpKeepalive() for any the server
connection when the following timeouts are set: icap_io_timeout,
ident_timeout, read_timeout, request_timeout,
        server_idle_pconn_timeout, write_timeout using the configured values
for those timeouts as the maximum keep-alive period.

Amos
Received on Tue Jan 28 2014 - 00:33:38 MST

This archive was generated by hypermail 2.2.0 : Tue Jan 28 2014 - 12:00:06 MST