Search

Keep in touch (tcp keepalives etc.)

0 views
You can't please everyone, so you got to please yourself.. ( So, if we look in /proc/sys/net/ipv4 on a recent Linux box, we'll find three items related to this: $ ls -l *keep* -rw-r--r-- 1 root root 0 Feb 8 07:04 tcp_keepalive_intvl -rw-r--r-- 1 root root 0 Feb 8 07:04 tcp_keepalive_probes -rw-r--r-- 1 root root 0 Feb 8 07:04 tcp_keepalive_time $ cat *keep* 75 9 7200 That says wait 7200 seconds before sending a keepalive probe, then send up to 9 at 75 second intervals. Add that all up and it's 2 hours, 11 minutes and 15 seconds before tcp decides the connection is dead. Depending upon what you had in mind, that may be far too long or far too short. If I put my Mac to sleep for half an hour while I have lunch, I don't want my ssh connnection dropped. On the other hand, if I have an application that needs fresh data from that server every fifteen minutes, I don't want to wait two hours to find out I have a problem. Ricky? Could we have that chorus one more time? While you can easily muck with tcp's idea of proper values for these keepalive parameters, the reality is that these are application problems, and the applications should deal with them. Each application has its own needs, and should set its own criteria. How much control you have varies. The Linux telnet daemon normally does keepalives, but can be told not to by adding "-n" to its startup parameters: $ cat /etc/xinetd.d/*telnet* # default: off # description: The kerberized telnet server accepts normal telnet sessions, \ #            but can also use Kerberos 5 authentication. service telnet {       flags = REUSE      socket_type = stream       wait       = no       user       = root       server       = /usr/kerberos/sbin/telnetd       server_args       = -n       log_on_failure += USERID } SCO's telnet daemon has much more control than just on or off: (from APLawrence.com Add to document.write("Del.icio.us") | Yahoo! My Web A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!