我
lsof | grep CLOSE_WAIT | wc -l
在ubuntu 14.04 LTS上
我显示了PID和TID。假设在具有x个线程java进程上有70个CLOSE_WAITs。
但是,如果我这样做了
lsof -i | grep CLOSE_WAIT |wc -l
我只得到了1,这是java进程(无TID)。
这是否意味着我们不能通过做lsof -i来可靠地找出FS泄漏?我们总是要用"lsof“吗?
作为一个侧栏,有人知道为什么ELB没有关闭连接吗?
java 9645 9863 ubuntu 133u IPv4 19375 0t0 TCP ip-10-20-187-89:51548->ec2-100-200-86-25.compute-1.amazonaws.com:https (CLOSE_WAIT) java 9645 9864 ubuntu 133u IPv4 19375 0t0 TCP ip-10-20-187-89:51548->ec2-100-200-86-25.compute-1.amazonaws.com:https (CLOSE_WAIT) java 9645 9865 ubuntu 133u IPv4 19375 0t0 TCP ip-10-20-187-89:51548->ec2-100-200-25.compute-1.amazonaws.com:https (CLOSE_WAIT) java 9645 9902 ubuntu 133u IPv4 19375 0t0 TCP ip-10-20-187-89:51548->ec2-100-200-25.compute-1.amazonaws.com:https (CLOSE_WAIT)
谢谢,
发布于 2015-07-17 10:24:45
我推荐咨询a diagram like this one。TCP连接不会被认为是关闭的,每一端都会发送FIN并获得ACK。
As stated here。CLOSE_WAIT通常表示远程端已发送FIN并已被本地端确认,但本地端尚未发送FIN。
您很可能看不到使用lsof -i的其余CLOSE_WAIT条目,因为没有显示远程地址。它很可能显示为空。
另请参阅:
https://superuser.com/questions/173535/what-are-close-wait-and-time-wait-states
https://stackoverflow.com/questions/31466827
复制相似问题