0

The parameter controls how frequently TCP tries to verify that an idle connection is still intact by sending a keepalive packet. If the remote computer is still reachable and functioning, the remote computer acknowledges the keepalive transmission. By default, keepalive packets are not sent. A program can turn on this feature on a connection.

The default for KeepAliveTime is 2 hours. This seems way too long. If I have a dead network connection, I want to know about it and have the application respond to it much sooner than 2 hours later. I don't see any issue with setting this value as low as 5 minutes - the bandwidth usage would be negligible.

Why is the default for KeepAliveTime so long and is it safe to set it to a lower number, e.g. 5 minutes?

1 Answer 1

1

It may make sense to lower the keepalive time if you are running a server that wants to know whether its clients are still alive, and your application sets the keepalive socket option. Setting this to 5 minutes is pretty reasonable in that case.

Consider for example this advice given to users of the ESRI CAD software on configuring keepalive: http://support.esri.com/ja/knowledgebase/techarticles/detail/25129

Would it matter for your application that a socket stays open for 5 minutes or 2 hours?

1
  • It matters for a particular batch processing application which goes into a hanged state when the network connection goes down. It can recover from a dropped connection by retrying but waiting two hours means that it has a lot of downtime before it attempts to reconnect. I think I'm going to go ahead and set it to 5 minutes.
    – Jim
    Feb 10, 2015 at 12:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .