TCP KeepAlive support
- Last Updated: January 24, 2025
- 2 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
The Db2 driver supports the KeepAlive connection setting, which allows the TCP socket to keep an idle connection active by transmitting packets between the client and server. See "KeepAlive" for more details.
Note: The process to configure the KeepAlive property described in this section is valid at
the time of publication. For latest information on the process, refer to the following links
for your operating system:
The following steps describe how you can enable this feature for the following operating systems.
Windows:
- Launch the registry and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
- Create a
KeepAliveIntervalparameter of the REG_DWORD type with an interval value in milliseconds. For example, 10000 for 10 seconds. - Create a
KeepAliveTimeparameter of the REG_DWORD type with the number of milliseconds to wait before resending a KeepAlive packet. For example, 3600000 for 1 hour. - Restart the operating system.
Linux:
- Set the time interval between the probes using the following command
from the root
account:
echo interval_value > /proc/sys/net/ipv4/tcp_keepalive_intvl - Set the maximum number of probes using the following
command:
echo probe_value > /proc/sys/net/ipv4/tcp_keepalive_probes - Restart the operating system.
Solaris:
- Set the KeepAlive interval value using the following command from the
root
account:
ndd -set /dev/tcp tcp_keepalive_interval interval_value - Restart the operating system.
HP-UX:
- Set the KeepAlive interval value using the following command from the
root
account:
ndd -set /dev/tcp tcp_keepalive_interval interval_value - Set the maximum number of probes using the following
command:
ndd -set /dev/tcp tcp_keepalive_kill probe_value - Restart the operating system.
AIX:
- Set the KeepAlive interval value using the following command from the
root
account:
no -o tcp_keepidle=interval_value - Set the interval between KeepAlive packets to maintain a connection
using the following
command:
no -o tcp_keepintvl=interval_value - Restart the operating system.
Note: To permanently change the values for AIX, HP-UX, Solaris, and Linux, set the values
while the system is starting by modifying the startup script.