参考文章:http://blog.csdn.net/ctthuangcheng/article/details/8596818
[root@mdw-2 gpadmin]# vi /etc/sysctl.conf
追加添加如下:
net.ipv4.tcp_keepalive_time=90 net.ipv4.tcp_keepalive_intvl=15 net.ipv4.tcp_keepalive_probes=2
使生效:
[root@mdw-2 gpadmin]# sysctl -p kernel.shmmax = 500000000 kernel.shmmni = 4096 kernel.shmall = 4000000000 kernel.sem = 250 512000 100 2048 kernel.sysrq = 1 kernel.core_uses_pid = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.msgmni = 2048 net.ipv4.tcp_syncookies = 1 net.ipv4.ip_forward = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.conf.all.arp_filter = 1 net.ipv4.ip_local_port_range = 1025 65535 net.core.netdev_max_backlog = 10000 net.core.rmem_max = 2097152 net.core.wmem_max = 2097152 vm.overcommit_memory = 2 net.ipv4.tcp_keepalive_time = 15 net.ipv4.tcp_keepalive_intvl = 1 net.ipv4.tcp_keepalive_probes = 3
查看:
[root@mdw-2 gpadmin]# sysctl -a | grep keepalive net.ipv4.tcp_keepalive_time = 15 net.ipv4.tcp_keepalive_probes = 3 net.ipv4.tcp_keepalive_intvl = 1