It's frankly long past time that we turn net.inet.tcp.always_keepalive
commitab0c462315e40d83764117b87ecb85cbf564b0b0
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 30 Mar 2008 20:39:01 +0000 (30 20:39 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 30 Mar 2008 20:39:01 +0000 (30 20:39 +0000)
tree42dafa7d28fecf0ae5c6a0a562a6848a4dacbb81
parente6c413b7036939d73d6d183e1224683a23abffbc
It's frankly long past time that we turn net.inet.tcp.always_keepalive
on by default.

The default test internal is 2 hours of idle (left unchanged).  I am not
going to make it shorter but I will note that while you might not have wanted
to have the feature enabled 15 years ago (because many people were using
demand-dial), these days you actually almost universally want the feature
enabled for a multitude of reasons:

(1) Because you will often be running over a NAT and can lose the NAT
    entry if the connection stays idle with no traffic at all for too
    long a period of time.

(2) Because you will often be running over stateful filters which can also
    get confused and lose the table entry if they see no traffic for too
    long a period of time.

(3) Because having this turned on guarantees that stuck tcp connections,
    especially those generated through batch operations, will eventually
    get unstuck.  A TCP connection can become stuck if it is waiting on
    data and the remote end has closed the connection, but the RST got lost.
    Without this feature such connections can remain stuck literally
    forever.

In some cases you might even need a far shorter interval but that is another
issue not addressed by this commit.
sys/netinet/tcp_timer.c