It's frankly long past time that we turn net.inet.tcp.always_keepalive
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 30 Mar 2008 20:39:01 +0000 (20:39 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 30 Mar 2008 20:39:01 +0000 (20:39 +0000)
commit09517e504794e7dc343a11d58e2d1baba3841c22
tree48de026fd99a7edccd89bd06058e8fd219ecc861
parent5899c36d7f3e624f131e6c2eab2d47c983b6ea5e
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