webbench和apachebench服务器压力测试你了解吗?
webbench压力测试安装
1、下载安装包
wget http://www.ha97.com/code/webbench-1.5.tar.gz
2、解压安装包
tar zxvf webbench-1.5.tar.gz
3、安装和编译
cd webbench-1.5
make && make install错误解决方式
mkdir -m 644 -p /usr/local/man/man1
yum install ctags
webbench使用命令
webbench -c 1000 -t 30 http://www.tanwan.com/
-c是指并发数
-t是指请求时间
webbench命令结果
Speed=24920 pages/min, 21037312 bytes/sec.
Requests: 24833 susceed, 87 failed.
主要看是否有失败数(failed),有的话说明网站超过负荷了
apachebench压力测试
只要安装了apache,会自带ab压力测试
apachebench使用命令
ab -c 10 -n 100 http://www.tanwan.com/
-c是指并发数
-n是指请求总数
apachebench命令结果
Server Software: nginx/1.10.2 #服务器类型
Server Hostname: www.jiangliang738.cn #域名
Server Port: 80 #端口
Document Path: / #根目录
Document Length: 10 bytes
Concurrency Level: 10
Time taken for tests: 2.677 seconds #测试时间
Complete requests: 100 #完成的请求数量
Failed requests: 0 #失败的请求
Total transferred: 17200 bytes
HTML transferred: 1000 bytes
Requests per second: 37.36 [#/sec] (mean)
Time per request: 267.700 (mean)
Time per request: 26.770 (mean, across all concurrent requests)
Transfer rate: 6.27 received
Connection Times (ms)
minmean[+/-sd] median max
Connect: 7 26 140.0 10 1411
Processing: 11231 414.8 93 1650
Waiting: 11196 412.7 68 1637
Total: 20257 434.9 104 1666
Percentage of the requests served within a certain time (ms)
50% 104 #50%的请求处理时间在100毫秒左右
66% 140
75% 146
80% 152
90% 1516
95% 1538
98% 1548
99% 1666
100% 1666 (longest request)
主要看Failed requests,不为0说明网站超过负荷了
页:
[1]