Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jun 1999 15:26:54 -0700
From:      Peter Wemm <peter@netplex.com.au>
To:        Nate Williams <nate@mt.sri.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, dg@root.com, "John R. LoVerso" <loverso@sitaranetworks.com>, current@FreeBSD.ORG
Subject:   Re: net.inet.tcp.always_keepalive on as default ? 
Message-ID:  <199906042226.PAA02634@peterw.yahoo.com>
In-Reply-To: Your message of "Fri, 04 Jun 1999 13:31:20 MDT." <199906041931.NAA28493@mt.sri.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams wrote:
> > How about this then:
> > 
> > 	net.inet.tcp.always_keepidle: 86400	/* new variable */
> > 	net.inet.tcp.always_keepintvl: 64800	/* new variable */
> > 	net.inet.tcp.keepidle: 14400
> > 	net.inet.tcp.keepintvl: 150
> > 	net.inet.tcp.always_keepalive: 1
> > 
> > This will have all sockets have keepalives, but if the program
> > specifically sets keepalives, it gets the shorter timeout.
> 
> That's essentially what I proposed a couple days ago.

I think the always_keepintvl values above are pretty over the top..  We
send a grand total of 8 keepalive packets every keepintvl slowtimeouts.
In the SO_KEEPALIVE case, after nothing has been received for 2 hours,
we send a keepalive packet every 75 seconds for a total of 8 times.  If
we still get nothing after 8 * 75 = 10 minutes, we drop the connection.

The example above is a bit far out because after 12 hours we'd probe and
retry every 540 minutes (9 hours) if there was no response for a total
of 8 times - 8 * 9 = 72 hours.  ie: it would take 3 days to clean a dead
connection based on a lousy sample of 8 packets over those 3 days.

I'd suggest always_keepidle = 86400 (12 hours) and always_keepinvl = 300
(20 minutes), and perhaps a new variable keepcnt and always_keepcnt
so that we can retry more than 8 times if you have lossy links.

IMHO, even the more aggressive existing keepalive values are so close to
trivially small amounts of traffic, I'd much rather use the 14400/150 values
for everything.  I'd be really *really* suprised if long idle tcp sessions
were statistically significant.  I know I have telnet sessions that can
have idle times of days, but compared to ftp/http/etc traffic it's a mere
drop in the ocean.  I can't think of any other common case of long idle
open tcp sessions other than telnet and co. 

> Nate
> 

Cheers,
-Peter



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?199906042226.PAA02634>