標籤:http com 資料 os cti for
如何查看Web效勞器並發懇求銜接數1、查看Web效勞器(Nginx Apache)的並發懇求數及其TCP銜接狀態: netstat -n | awk \‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}\‘netstat -n|grep ^tcp|awk \‘{print $NF}\‘|sort -nr|uniq -c 或者:netstat -n | awk \‘/^tcp/ {++state[$NF]} END {for(key in state) print key,\"t\",state[key]}\‘返回結果普通如下: LAST_ACK 5 (正在等候處置的懇求數)
SYN_RECV 30 connecting: http://www.metabase.cn/ time out :25s
SYN_RECV 30 connecting: http://www.jinanwuliangye.com time out :25s
SYN_RECV 30 connecting: http://www.tongxinglong.com/ time out :25s
SYN_RECV 30 connecting: http://www.qclchina.com/ time out :25s
SYN_RECV 30 connecting: http://www.vipfuxin.com/ time out :25s
SYN_RECV 30 connecting: http://www.minnan888.net/ time out :25s
SYN_RECV 30 connecting: http://www.lcsyt.com/ time out :25s
SYN_RECV 30 connecting: http://lf.yunnanw.cn time out :25s
SYN_RECV 30 connecting: http://www.ceocbs.com/ time out :25s
SYN_RECV 30 connecting: http://www.yzbljp.com/ time out :25s
SYN_RECV 30 connecting: http://www.hyyfscl.com/ time out :25s
SYN_RECV 30 connecting: http://www.shoudashou.com/ time out :25s
SYN_RECV 30 connecting: http://www.shuoma.com.cn/ time out :25s
ESTABLISHED 1597 (正常資料轉送狀態)FIN_WAIT1 51FIN_WAIT2 504TIME_WAIT 1057 (處置終了,等候逾時完畢的懇求數) 其他參數闡明: CLOSED:無銜接是活動的或正在停止LISTEN:效勞器在等候進入呼叫SYN_RECV:一個銜接懇求曾經抵達,等候確認SYN_SENT:應用曾經開端,翻開一個銜接ESTABLISHED:正常資料轉送狀態FIN_WAIT1:應用說它曾經完成FIN_WAIT2:另一邊已同意釋放ITMED_WAIT:等候一切分組死掉CLOSING:兩邊同時嘗試關閉TIME_WAIT:另一邊已初始化一個釋放LAST_ACK:等候一切分組死掉 2、查看Nginx運轉進程數ps -ef | grep nginx | wc -l返回的數字就是nginx的運轉進程數,假如是apache則執行ps -ef | grep httpd | wc -l 3、查看Web效勞器進程銜接數:netstat -antp | grep 80 | grep ESTABLISHED -c 4、查看MySQL進程銜接數:ps -axef | grep mysqld -c