1.windows的服务器出现
netstat -nao | find /c "TIME_WAIT" 用来查看TIME_WAIT进程
公司的win2003主机安装完客户端后莫名其妙掉线,用 netstat -ano |find "10050" 发现很多time_wait进程如图
解决办法
修改TCP的time_wait时间
方法:
regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
新建2个DWORD
MaxUserPort=0000fffe
TcpTimeWaitDelay=0000005
记得这是16进制的
2.linux的服务器出现
/etc/sysctl.conf 添加下面的2行,然后执行sysctl -p
net.ipv4.tcp_keepalive_time = 1800 # tcp连接保持时间为1800秒
net.ipv4.tcp_tw_recycle = 1 # 回收TIME_WAIT占用的连接
[root@te