Linux Web服务器连接数控制
平时检测网站服务器连接数情况,常用的如 netstat -ant |awk ‘{print $6}’|sort|uniq -c |sort -n 给出如下统计
TIME_WAIT 3699 CLOSE_WAIT 52 FIN_WAIT1 32 SYN_SENT 1 FIN_WAIT2 2 ESTABLISHED 17 SYN_RECV 45 CLOSING 6
有时会发现大量的TIME_WAIT,SYN_RECV, CLOSE_WAIT , FIN_WAIT状态,此时需要对系统参数做些调整:
vi /etc/sysctl net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 1000 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_window_scaling = 0 net.ipv4.tcp_sack = 0 net.ipv4.tcp_max_syn_backlog = . . . → Read More: linux-SYN-netstat TIME_WAIT
最新评论