netstat大量time_wait连接

http://chembo.iteye.com/blog/1503770

http://www.2cto.com/os/201007/54067.html

http://blog.csdn.net/dacong/article/details/50485585

主动关闭一方会进入一个TIME_WAIT的中间状态. 通过netstat 查看到的内容如下:

tcp 0 0 10.19.67.11:40184 10.19.67.11:7012 TIME_WAIT
tcp 0 0 10.19.67.11:39167 10.19.67.11:7012 TIME_WAIT

是 40184的端口主动关闭,处于TIME_WAIT状态。

检查一下time wait的值:

 [root@vFStor-1RTqI ~]# sysctl -a | grep time | grep wait
net.netfilter.nf_conntrack_tcp_timeout_close_wait =
net.netfilter.nf_conntrack_tcp_timeout_fin_wait =
net.netfilter.nf_conntrack_tcp_timeout_time_wait =
[root@vFStor-1RTqI ~]#

检查net.ipv4.tcp_tw当前值:

 [root@vFStor-1RTqI ~]# sysctl -a|grep net.ipv4.tcp_tw
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_tw_reuse =
[root@vFStor-1RTqI ~]#

修改 /etc/sysctl.conf 配置文件,添加内容。

重新生效sysctl.conf 配置文件:

 [root@vFStor-1RTqI ~]# sysctl -p
net.ipv4.ip_forward =
net.ipv4.conf.default.rp_filter =
net.ipv4.conf.default.accept_source_route =
kernel.sysrq =
kernel.core_uses_pid =
net.ipv4.tcp_syncookies =
net.bridge.bridge-nf-call-ip6tables =
net.bridge.bridge-nf-call-iptables =
net.bridge.bridge-nf-call-arptables =
net.ipv4.tcp_tw_reuse =
net.ipv4.tcp_tw_recycle =
上一篇:linux-``反引号


下一篇:Hibernate学习笔记(1)---hibernate快速上手与准备工作