Long keepidle time

Mike Silbersack silby at silby.com
Wed Aug 30 08:00:23 UTC 2006


On Fri, 18 Aug 2006, Chris wrote:

> whats the point of keeping a connection alive (hung) to a dead network
> for 2 hours tho? That I dont understand either.
>
> Chris

I used to wonder that myself.  From the perspective of minimizing the 
number of open sockets, it makes sense to kill connections to dead 
networks as quickly as possible.

However, there are other things to consider:

1.  Is it TCP's problem to care whether or not the connection is alive? 
Most applications that open a large number of connections (web servers, 
etc) are smart enough to notice that the other end of the connection has 
gone silent and automatically terminate the connection.

2.  If your application tries to transmit data to the dead machine, the 
TCP retransmit timer will cause the connection to be terminated, so there 
is no need for keepalive to help in that case.

3.  In the case of telnet / ssh sessions, you don't want keepalive being 
too active.  When I go to bed, my ssh sessions will be idle for at least 6 
hours.  If my cable modem provider decides to do maintenance during that 
time, it would be nice if the ssh sessions survive.  If keepalive was 
checking every 5 minutes, it might needlessly terminate the connection.

So, in summary, there are many opinions about keepalives.  That's why 
everything about them is tunable. :)

Mike "Silby" Silbersack


More information about the freebsd-net mailing list