小编Mur*_*xim的帖子

如何调试未关闭的CLOSE_WAIT连接的原因?(tcpdump 等)

我们将 Java 应用程序和 Nginx 作为反向代理安装在同一主机上。定期地,我们会发现CLOSE_WAIT连接长时间挂起:

$ ss -n4t | head
State      Recv-Q Send-Q  Local Address:Port    Peer Address:Port
CLOSE-WAIT 1      0           127.0.0.1:8180       127.0.0.1:36599
CLOSE-WAIT 1      0           127.0.0.1:8180       127.0.0.1:36467
CLOSE-WAIT 1      0           127.0.0.1:8180       127.0.0.1:36154
Run Code Online (Sandbox Code Playgroud)

而且数量不断增加,那么应用程序就会出现问题。互联网上说:

Your server is failing to detect client disconnects, or ignoring them, and not closing the socket.
Run Code Online (Sandbox Code Playgroud)

Nginx 说:

2020/06/28 04:59:15 [error] 65506#0: *31719640 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 55.55.55.55, server: app.mycompany.com, request: "POST /url/url HTTP/1.0", upstream: …
Run Code Online (Sandbox Code Playgroud)

networking tcp nginx tcpdump wireshark

6
推荐指数
0
解决办法
1447
查看次数

标签 统计

networking ×1

nginx ×1

tcp ×1

tcpdump ×1

wireshark ×1