-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 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 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 requestsCompleted 800 requestsCompleted 900 requestsCompleted 1000 requestsFinished 1000 requestsServer Software: Apache Server Hostname: www.a.comServer Port: 80Document Path: /01.htmlDocument Length: 23 bytes #01.html的 长度为23字节Concurrency Level: 100 #并发量为100Time taken for tests: 0.448 seconds #1000个请求花费了0.448秒Complete requests: 1000 #总的请求数目Failed requests: 0Total 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 #传输速率
#2742021年05月19日2021年05月19日.448=587kbytes/secConnection Times (ms) min mean[+/-sd] median maxConnect: 0 1 1.0 0 4Processing: 7 42 6.6 42 68Waiting: 7 42 6.5 42 60Total: 11 43 6.2 42 68Percentage 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/1221842021年05月19日83964