Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Jun 1999 07:35:42 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        current@FreeBSD.ORG
Subject:   Re: net.inet.tcp.always_keepalive on as default ? 
Message-ID:  <54651.928560942@critter.freebsd.dk>
In-Reply-To: Your message of "Fri, 04 Jun 1999 15:26:54 PDT." <199906042226.PAA02634@peterw.yahoo.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

Well, we've heard various opinions and I think we can conclude that:

1.  Even with the current timeouts, there is no significant increase
    in network trafic, even with the market share FreeBSD has.

2.  That server applications should have keepalives enabled.

3.  That the few people, for whom it could become a problem if it
    is enabled by default, are prefectly capable of changing a
    variable in /etc/rc.conf.

4.  It would be desirable to have per socket timeouts, but would
    require application changes which are unlikely to happen.

5.  Changing the timeouts would potentially mean trouble for certain
    applications.

QED:  The following patch.

If you don't like this, remember to change that variable in
/etc/rc.conf in the future.

Poul-Henning

Index: rc.network
===================================================================
RCS file: /home/ncvs/src/etc/rc.network,v
retrieving revision 1.44
diff -u -r1.44 rc.network
--- rc.network	1999/04/12 15:26:41	1.44
+++ rc.network	1999/06/05 05:25:51
@@ -180,6 +180,11 @@
 	    sysctl -w net.inet.ip.accept_sourceroute=1 >/dev/null 2>&1
     fi
 
+    if [ "X$tcp_keepalive" = X"YES" ]; then
+	    echo -n ' TCP keepalive=YES'
+	    sysctl -w net.inet.tcp.always_keepalive=1 >/dev/null 2>&1
+    fi
+
     if [ "X$ipxgateway_enable" = X"YES" ]; then
 	    echo -n ' IPX gateway=YES'
 	    sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null 2>&1
Index: defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.9
diff -u -r1.9 rc.conf
--- rc.conf	1999/05/16 09:19:44	1.9
+++ rc.conf	1999/06/05 05:26:26
@@ -41,6 +41,7 @@
 natd_flags=""                   # Additional flags for natd.
 tcp_extensions="NO"		# Set to Yes to turn on RFC1323 extensions.
 log_in_vain="NO"		# Disallow bad connection logging (or YES).
+tcp_keepalive="YES"		# Kill dead TCP connections (or NO).
 network_interfaces="lo0"	# List of network interfaces (lo0 is loopback).
 ifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
 #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
FreeBSD -- It will take a long time before progress goes too far!


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54651.928560942>