Open vieyahn2017 opened 1 year ago
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}'
返回结果一般如下: LAST_ACK 5 (正在等待处理的请求数)
SYN_RECV 30 ESTABLISHED 1597 (正常数据传输状态) FIN_WAIT1 51 FIN_WAIT2 504 TIME_WAIT 1057 (处理完毕,等待超时结束的请求数)
Linux下查看Nginx Apache MySQL的并发连接数和连接状态。 https://blog.51cto.com/onlyzq/588358
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'