ab

 

[root@ok ok]# ab -c 10 -n 100000000 http://www.zhirs.com/index.html
#-c 10 表示并发用户数为10
#-n 100000000 这行表示同时处理100000000个请求并运行10次index.html文件

 

[root@app02 ~]# netstat -an|awk '/tcp/ {++S[$NF]}END{for (a in S)print a,S[a]}'
TIME_WAIT 4058
FIN_WAIT1 2
ESTABLISHED 1
SYN_RECV 2
LISTEN 6
[root@app02 ~]# free -h
             total       used       free     shared    buffers     cached
Mem:          237M       233M       4.1M       268K       5.8M       114M
-/+ buffers/cache:       113M       124M 
Swap:         991M       2.7M       989M 

 

[root@ok 线下人员照片 - 副本]# for i in $(seq 10);do curl http://www.zhirs.com;done
app02 ip:10.100.2.178
app01 ip:10.100.2.177
app01 ip:10.100.2.177
app02 ip:10.100.2.178
app01 ip:10.100.2.177
app01 ip:10.100.2.177
app01 ip:10.100.2.177
app02 ip:10.100.2.178
app02 ip:10.100.2.178
app01 ip:10.100.2.177

 ab命令的包:

yum install httpd-tools
# rpm -ql httpd-tools
/usr/bin/ab
/usr/bin/htdbm
/usr/bin/htdigest
/usr/bin/htpasswd
/usr/bin/httxt2dbm
/usr/bin/logresolve
/usr/share/doc/httpd-tools-2.4.6
/usr/share/doc/httpd-tools-2.4.6/LICENSE
/usr/share/doc/httpd-tools-2.4.6/NOTICE
/usr/share/man/man1/ab.1.gz
/usr/share/man/man1/htdbm.1.gz
/usr/share/man/man1/htdigest.1.gz
/usr/share/man/man1/htpasswd.1.gz
/usr/share/man/man1/httxt2dbm.1.gz
/usr/share/man/man1/logresolve.1.gz

 

posted @ 2016-10-31 14:17  bass  阅读(193)  评论(0编辑  收藏  举报