change net.ipv4.tcp_keepalive

% : sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_redirects = 0
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 15204352
kernel.shmmax = 62277025792
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.nr_hugepages = 29696
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_redirects = 0
vm.swappiness = 1

% : sysctl -a|grep tcp_keep
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200
sysctl: reading key “net.ipv6.conf.all.stable_secret”
sysctl: reading key “net.ipv6.conf.default.stable_secret”
sysctl: reading key “net.ipv6.conf.eth0.stable_secret”
sysctl: reading key “net.ipv6.conf.lo.stable_secret

1. Edit your /etc/sysctl.conf
# vi /etc/sysctl.conf
2. Add the following setting :
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 10
net.ipv4.tcp_keepalive_probes = 6
Explanation for above parameter in section a), b) and c).

3. To load settings, enter the following command :
# sysctl -p

 

Reference:

https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html
https://docs.pingidentity.com/bundle/pingaccess-60/page/nll1571950354674.html
https://itblog.webdigg.org/302-how-to-reload-sysctl-conf-variables-on-linux/

How to Configure Linux TCP keepalive Setting


https://access.redhat.com/solutions/548813
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/configuring-kernel-parameters-at-runtime_managing-monitoring-and-updating-the-kernel
To list all parameters, use the following:
# sysctl -a
The command displays all kernel parameters that can be configured at runtime.
To configure a parameter permanently:
# sysctl -w <TUNABLE_CLASS>.<PARAMETER>=<TARGET_VALUE> >> /etc/sysctl.conf
The sample command changes the tunable value and writes it to the /etc/sysctl.conf file, which overrides the default values of kernel parameters. The changes take effect immediately and persistently, without a need for restart.
NOTE
To permanently modify kernel parameters you can also make manual changes to the configuration files in the /etc/sysctl.d/ directory.

Leave a Reply

Your email address will not be published. Required fields are marked *