快速清除TIME_WAIT连接

  sre


/etc/sysctl.conf中
net.ipv4.tcp_max_tw_buckets = 5000
限制了大小,超过即回收
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

设置这两项可减少time_wait占用
/sbin/sysctl -p生效

One Reply to “快速清除TIME_WAIT连接”

  • netstat -n|awk ‘/^tcp/{++S[$NF]}END{for (key in S) print key,S[key]}’ 查看各状态连接数分布

LEAVE A COMMENT

Captcha Code