Great. None of this should be an issue. My application sends it's
own keepalive/heartbeat packets every 30-60 seconds. So, it sounds
like the timeout will only kick in if there is no activity on the
socket, correct? If that's the case, then I'll probably have fairly
short timeout settings, to ensure we don't have a bunch of garbage
connections up.
thanks.
On Mon, Mar 8, 2010 at 1:16 AM, Willy Tarreau <
[email protected]> wrote:
> Hello,
>
> On Sun, Mar 07, 2010 at 08:46:08PM -0500, Geoffrey Mina wrote:
>> Hello,
>> I am evaluating HAProxy for an application which utilizes persistent
>> TCP connections. We often go days, weeks, or even months without
>> causing a TCP disconnect/reconnect. Any issues I should be aware of
>> before I get too far down the path? This will just be straight TCP
>> load-balancing, no HTTP involved.
>
> Having some connections remain established for months is not an issue
> at all. However you should still be careful about your timeouts, because
> if a connection remains inactive for a long time, there is no was to
> distinguish that from a frozen connection. So maybe you can set large
> timeouts of 1 hour, 1 day or something like this in order to get rid
> of dead connections without having to restart the process. The largest
> timeout you can set is 24 days, due to the internal precision of one
> millisecond.
>
> You should also enable tcp keepalives (option tcpka) so that the
> system regularly tests connections. By default, some systems send
> them every 2 hours, and actively kill the connection after several
> failures.
>
> You should also be careful about your config changes, because if you
> restart, you'll break your connections (unless you restart with -sf,
> but it will be hard to troubleshoot when running multiple concurrent
> processes).
>
> Regards,
> Willy
>
>