ApacheBench (AB):网页压力测试
![](https://img-blog.csdn.net/20141016165709390?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzY5NTY3MQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
![]()
ab是apache 自带的,简单的,好用的压力测试工具。安装完Apache后,
可以在bin目录下找到
ab.exe 。
1. 查看linux虚拟机上是否安装了apache .没有安装Apache 的要先安装apache .
2. 简单的对sina网页进行压力测试
3 .然后会弹出很多的信息
4.apacheBenche 各种参数详解
Server Software: nginx
Server Hostname: www.sina.com ##请求的机子
Server Port: 80 ##请求端口
Document Path: /
Document Length: 178 bytes ##页面长度
Concurrency Level: 10 ##并发数
Time taken for tests: 0.0091 seconds ##共使用了多少时间
Complete requests: 100 ##请求数
Failed requests: 0 ##失败请求
Write errors: 0
Total transferred: 47959 bytes ##总共传输字节数,包含http的头信息等
HTML transferred: 17800 bytes ##html字节数,实际的页面传递字节数
Requests per second: 1096.65[#/sec] (mean) ##每秒多少请求,这个是非常重要的参数数值,服务器的吞吐量
Time per request: 9.119 [ms] (mean) ##用户平均请求等待时间
Time per request: 0.912 [ms] (mean, across all concurrent requests) ##服务器平均处理时间,
Server Hostname: www.sina.com ##请求的机子
Server Port: 80 ##请求端口
Document Path: /
Document Length: 178 bytes ##页面长度
Concurrency Level: 10 ##并发数
Time taken for tests: 0.0091 seconds ##共使用了多少时间
Complete requests: 100 ##请求数
Failed requests: 0 ##失败请求
Write errors: 0
Total transferred: 47959 bytes ##总共传输字节数,包含http的头信息等
HTML transferred: 17800 bytes ##html字节数,实际的页面传递字节数
Requests per second: 1096.65[#/sec] (mean) ##每秒多少请求,这个是非常重要的参数数值,服务器的吞吐量
Time per request: 9.119 [ms] (mean) ##用户平均请求等待时间
Time per request: 0.912 [ms] (mean, across all concurrent requests) ##服务器平均处理时间,
也就是服务器吞吐量的倒数
Transfer rate: 513.61[Kbytes/sec] received ##每秒获取的数据长度
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 4 1.6 4 9
Processing: 3 4 2.5 4 27
Waiting: 3 4 2.5 4 27
Total: 6 9 3.0 8 31
Percentage of the requests served within a certain time (ms)
50% 8 ## 50%的请求在8ms内返回
66% 9 ## 60%的请求在9ms内返回
75% 9
80% 10
90% 12
95% 13
98% 15
99% 31
100% 31 (longest request)
Transfer rate: 513.61[Kbytes/sec] received ##每秒获取的数据长度
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 4 1.6 4 9
Processing: 3 4 2.5 4 27
Waiting: 3 4 2.5 4 27
Total: 6 9 3.0 8 31
Percentage of the requests served within a certain time (ms)
50% 8 ## 50%的请求在8ms内返回
66% 9 ## 60%的请求在9ms内返回
75% 9
80% 10
90% 12
95% 13
98% 15
99% 31
100% 31 (longest request)