From owner-freebsd-current Fri Jun 4 15:33:11 1999 Delivered-To: freebsd-current@freebsd.org Received: from peterw.yahoo.com (peterw.yahoo.com [206.132.89.237]) by hub.freebsd.org (Postfix) with ESMTP id 9A799154A0 for ; Fri, 4 Jun 1999 15:33:08 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost.yahoo.com [127.0.0.1]) by peterw.yahoo.com (8.9.3/8.9.2) with ESMTP id PAA02634; Fri, 4 Jun 1999 15:26:54 -0700 (PDT) (envelope-from peter@netplex.com.au) Message-Id: <199906042226.PAA02634@peterw.yahoo.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Nate Williams Cc: Poul-Henning Kamp , dg@root.com, "John R. LoVerso" , current@FreeBSD.ORG Subject: Re: net.inet.tcp.always_keepalive on as default ? In-reply-to: Your message of "Fri, 04 Jun 1999 13:31:20 MDT." <199906041931.NAA28493@mt.sri.com> Date: Fri, 04 Jun 1999 15:26:54 -0700 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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