We recommend that you configure the following keepalive parameters on connection gateway devices to improve connection stability:
net.ipv4.tcp_keepalive_intvl specifies how often to send keepalive messages after the first one. Set this parameter to 1.net.ipv4.tcp_keepalive_probes specifies how many keepalive messages can be sent without a reply before the connection is considered dead. Set this parameter to 10.net.ipv4.tcp_keepalive_time specifies how long to wait after the last data packet before sending the first keepalive message. Set this parameter to 900.To configure keepalive parameters:
net.ipv4.tcp_keepalive_intvl = 1
net.ipv4.tcp_keepalive_probes = 10
net.ipv4.tcp_keepalive_time = 900
sudo sysctl -p /etc/sysctl.conf
sudo sysctl net.ipv4.tcp_keepalive_intvl
sudo sysctl net.ipv4.tcp_keepalive_probes
sudo sysctl net.ipv4.tcp_keepalive_time