TCP Keepalive

Links to OpenVMS-related documentation
Post Reply
User avatar
issinoho
Site Admin
Posts: 241
Joined: Tue Feb 01, 2005 12:53 am
Location: Scotland
Contact:

TCP Keepalive

Post by issinoho »

The keepalive function enables the periodic transmission of messages on a connected socket in order to keep connections active. Sockets that do not exit cleanly are cleaned up when the keepalive interval expires. If keepalive is not enabled, those sockets continue to exist until you reboot the system.

Applications enable keepalive for sockets by setting the setsockopt function’s SO_KEEPALIVE option. To override programs that do not set keepalive, or if you do not have access to the application sources, use the inet subsystem attribute tcp_keepalive_default to enable keepalive functionality.

Performance Benefit
Keepalive functionality cleans up sockets that do not exit cleanly when the keepalive interval expires.
You can modify the tcp_keepalive_default attribute without rebooting the system. However, sockets that already exist will continue to use old behavior, until the applications are restarted.

When to Tune
Enable keepalive if you require this functionality, and you do not have access to the source code.

Recommended Values
To override programs that do not set keepalive, or if you do not have access to application source code, set the inet subsystem attribute tcp_keepalive_default to 1 in order to enable keepalive for all sockets.
If you enable keepalive, you can also configure the TCP options listed below for each socket.

tcp_keepidle Specifies the amount of idle time, in seconds, before sending a keepalive probe. The default interval is two hours.
tcp_keepintvl Specifies the amount of time, in seconds, between retransmission of keepalive probes. The default interval is 75 seconds.
tcp_keepcnt Specifies the maximum number of keepalive probes that are sent before the connection is dropped. The default is 8 probes.
tcp_keepinit Specifies the maximum amount of time, in seconds, before an initial connection attempt times out. The default is 75 seconds.

Code: Select all

sysconfig -r inet tcp_keepalive_default=1
https://community.hpe.com/t5/Operating- ... Eek4NVxeUk
Post Reply