Subject: Re: Detecting broken connection

Re: Detecting broken connection

From: Jose Baars <peut_at_peut.org>
Date: Thu, 15 Jul 2010 00:10:38 +0200

Op 7/14/2010 9:19 PM, Peter Stuge schreef:
> Beware. Enabling TCP keepalive is not neccessarily a feature. For
> example on a laptop which may have intermittent VPN connectivity, I
> consider the keepalive default in Linux to be really superior.
Agree, you have to take a conscious decision, keepalive is not all
moonshine and roses.

But, on servers on a fixed network with time critical connections where
connections
should fail over to another node or bomb out with fireworks as soon as a
connection
is broken, not having keepalive is killing. The same applies to an
application that uses
dozens of connections, you might run in to a situation where you are tending
a socket graveyard.

Point is that the default on Linux ( sockets have no keep alive enabled
) can not be changed.
It can be changed on *BSD and a lot of BSD derived TCP/IP stacks.
The application MUST call setsockopt to turn it on.

And it's still fine if you can afford to check and maybe change some
application you use (that is
the cost and advantage of open source), but a pain if you happen to be
forced to use
an application that doesn't set keepalive. I ran into it with rexec,
which could not easily be
changed due to all kinds of non-technical issues. I was a bit shocked to
find out that
Linux doesn't support setting the system default so that every socket
created would
have KEEPALIVE enabled. I can't see the advantage of not supporting that.

The SSH keepalive options might mitigate this, but I did not try,
> so no idea.

Yeah, they'll do the trick too.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Received on 2010-07-15