原文連接:https://blog.csdn.net/qq_27517377/article/details/78794409html
yum -y install httpd-tools
ab -v 查看ab版本
ab –help服務器
ab -n1000 -c 10 http://www.91cnm.com/併發
http://www.91cnm.com/是個人小網站掛在虛擬主機上的 ,-n訪問1000次, -c併發10個
ab壓力測試返回報文內容詳解:測試
Server Software: Apache #服務器軟件
Server Hostname: www.91cnm.com #域名
Server Port: 80 #請求端口號網站
Document Path: / #文件路徑
Document Length: 40888 bytes #頁面字節數.net
Concurrency Level: 10 #請求的併發數
Time taken for tests: 27.300 seconds #總訪問時間
Complete requests: 1000 #請求成功數量
Failed requests: 0 #請求失敗數量
Write errors: 0
Total transferred: 41054242 bytes #請求總數據大小(包括header頭信息)
HTML transferred: 40888000 bytes #html頁面實際總字節數
Requests per second: 36.63 [#/sec] (mean) #每秒多少請求,這個是很是重要的參數數值,服務器的吞吐量
Time per request: 272.998 [ms] (mean) #用戶平均請求等待時間
Time per request: 27.300 [ms] (mean, across all concurrent requests)
# 服務器平均處理時間,也就是服務器吞吐量的倒數
Transfer rate: 1468.58 [Kbytes/sec] received #每秒獲取的數據長度htm
Connection Times (ms)
min mean[+/-sd] median max
Connect: 43 47 2.4 47 53
Processing: 189 224 40.7 215 895
Waiting: 102 128 38.6 118 794
Total: 233 270 41.3 263 945blog
Percentage of the requests served within a certain time (ms)
50% 263 #50%用戶請求在263ms內返回
66% 271 #66%用戶請求在271ms內返回
75% 279 #75%用戶請求在279ms內返回
80% 285 #80%用戶請求在285ms內返回
90% 303 #90%用戶請求在303ms內返回
95% 320 #95%用戶請求在320ms內返回
98% 341 #98%用戶請求在341ms內返回
99% 373 #99%用戶請求在373ms內返回
100% 945 (longest request)
get