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 majord...@freebsd.org with "unsubscribe freebsd-current" in the body of the message