Quantcast
Channel: Good mind
Viewing all articles
Browse latest Browse all 511

watch - 파치 동시접속자수 확인 / 주기적 실행(watch) / netstat, watch

$
0
0
http://compeople.tistory.com/150

[ Linux ] 아파치 동시접속자수 확인Web Progreming 2011.12.26 00:08

* LISTEN 되는 모든 포트 : netstat -l 또는 netstat -nap | grep LISTEN
* 모든 서비스 동시 접속자 수 : netstat -nap | grep ESTABLISHED | wc -l
* 웹 동시 접속자 수 : netstat -nap | grep :80 | grep ESTABLISHED | wc -l
* 웹서버 커넥션수 체크 : netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l

 

** 리눅스 watch명령어를 이용한 주기적 명령어 실행

watch -n 1 "netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l"

watch 명령어로 1초 주기로 ""안에 있는 명령어를 실행

watch 명령어로 1초 주기로 웹서버 커넥션수 체크.

 

** 실행화면

[root@sclc ~]# watch -n 1 "netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l"

Every 1.0s: netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print }'|sed 's/:[0-9]*...  Fri Feb 17 13:18:40 2017

51



출처: http://compeople.tistory.com/150 [::WinLux-Compeople::+82-10-4621-0514]

Viewing all articles
Browse latest Browse all 511

Trending Articles