nginx等待连接过多

leo*_*leo 5 connection tcp nginx

我的Nginx状态在下面吗?

Active connections: 1156598
server accepts handled requests
     429477742 429477742 2435052040 
Reading: 353 Writing: 45136 Waiting: 1111109 
Run Code Online (Sandbox Code Playgroud)

我们可以看到,有1111109个等待连接。

但是用ss -s我只能得到24453 tcp连接:

Total: 17618 (kernel 0)
TCP:   24453 (estab 17007, closed 6489, orphaned 622, synrecv 0, timewait 6466/0), ports 0

Transport Total     IP        IPv6
*         0         -         -        
RAW       0         0         0        
UDP       2         2         0        
TCP       17964     17961     3        
INET      17966     17963     3        
FRAG      0         0         0 
Run Code Online (Sandbox Code Playgroud)

等待连接的值比TCP连接高得多,这是否正常?

Jos*_*iel 5

这些是保活连接。它们通常不是问题。但是,如果您想降低数量,请减少keepalive_timeout

https://www.ruby-forum.com/topic/203409