TCP/IP: setting keepalive interval
[keepalive] [KeepAliveTime] [so_keepalive] [tcp_keepalive_time]
Symptom
In some landscapes the router(firewall, bridge etc.) between two or more network segments could close the network connection if it remains inactive for longer time. Activated keepalive option for SAP application server does not help because keepalive interval (set by the operating system) is too large.
Other terms
keepalive, so_keepalive, KeepAliveTime, tcp_keepalive_time
Reason and Prerequisites
An idle connection is verified by TCP by sending so called “keep alive” packet. If remote computer is reachable it acknowledges the keep-alive packet. Keep alive packets are sent if the application support this option.
Default setting for keep alive might be configured too large and should be corrected.
Solution
Set 5 minutes for keepalive interval.
Windows:
Check MS KB 324270. If necessary set registry values (REG_DWORD
)
KeepAliveTime = 300000
KeepAliveInterval = 300000
for registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Linux:
Change the keepalive using sysctl utility.
Use following values
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_intvl = 300
AIX:
no -o tcp_keepidle = 600
no -o tcp_keepintvl = 600
HP-UX:
ndd -set /dev/tcp tcp_time_wait_interval 300000
ndd -set /dev/tcp tcp_keepalive_interval 300000
Solaris:
ndd -set /dev/tcp tcp_time_wait_interval 300000
ndd -set /dev/tcp tcp_keepalive_interval 300000
For other operating system consult system administrator.