-n 1000 :总的请求数
-c 100:并发数目为100,httpd.conf中的MaxClients表示并发量
[lw@www ~]$ ab -n1000 -c100 http://www.a.com/01.html //100个客户端发送1000个请求
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.a.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache
Server Hostname: www.a.com
Server Port: 80
Document Path: /01.html
Document Length: 23 bytes #01.html的 长度为23字节
Concurrency Level: 100 #并发量为100
Time taken for tests: 0.448 seconds #1000个请求花费了0.448秒
Complete requests: 1000 #总的请求数目
Failed requests: 0
Total transferred: 274000 bytes #总共传输的字节数目
HTML transferred: 23000 bytes #01.html 的长度为23*1000(请求数目)=23000B
Requests per second: 2230.24 [#/sec] (mean)
#每秒多少请求,总的请求数1000/花费的时间0.448=2230.24,这个数值为服务器吞吐量.
Time per request: 44.838 [ms] (mean)
#用户平均等待每个请求的时间,每个用户平均发送10个请求,所以
每个用户的平均等待每个请求的时间为0.448s/10=44.8ms
Time per request: 0.448 [ms] (mean, across all concurrent requests)
#服务器对每个请求平均处理时间,0.448s/1000=0.448ms,即为服务器吞吐量的倒数
Transfer rate: 596.76 [Kbytes/sec] received #传输速率
#27400/1024/0.448=587kbytes/sec
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.0 0 4
Processing: 7 42 6.6 42 68
Waiting: 7 42 6.5 42 60
Total: 11 43 6.2 42 68
Percentage of the requests served within a certain time (ms)
50% 42 //在41ms内处理了50%的请求
66% 45 //
75% 46
80% 46
90% 49
95% 53
98% 57
99% 60
100% 68 (longest request)
注释:
median:数学中的中数,对一组数进行排序后,正中间的一个数(数字个数为奇数);或者中间两个数的平均数(数字个数为偶数)。
mean:既可以表示算术平均数(所有元素相加除以个数),也可以表示几何平均数(所有元素相乘再开方,开方次数为元素个数).
心情:时间过的好快,这个初中学的东西都忘记了,自己百度的.
本文转自神ge 51CTO博客,原文链接:http://blog.51cto.com/12218412/1883964