原贴:http://www.sofee.cn/blog/2006/08/26/33/
Fix too many FIN_WAIT_2 connections under freebsd
查看FIN_WAIT_2连接数:
bsd#netstat -an | grep FIN_WAIT_2 | wc -l
2523
修改Lighttpd配置文件,加入下面这条语句:
server.max-keep-alive-requests = 0
bsd#netstat -an | grep FIN_WAIT_2 | wc -l
91
如果服务器开启了ipfw2防火墙的话,还需要执行:
sysctl -w net.inet.ip.fw.dyn_keepalive=0
p.s. 若为APACHE服务器,同理。