linux測試命令ab

2021-09-06 23:19:22 字數 2389 閱讀 9566

ab----apache bench是apache下的乙個工具,主要用於對web站點做壓力測試,它可以測試安裝web伺服器每秒種處理的http請求

引數說明

-n請求次數

-c每次的併發

-p傳送post請求時需要上傳的檔案,此外還必須設定-t引數

-t-c

新增cookid

-e輸出結果資訊到csv格式的檔案中

具體可檢視

man  ab
server software:        tornadoserver/5.0.2                          #軟體

server hostname: ***.***.xx.*** #ip位址

server port: 12345 #埠

document path: /parser #路徑

document length: 3190 bytes # 頁面的位元組

concurrency level: 5 #當前併發

time taken for tests: 3.158 seconds #測試耗時

complete requests: 100 #總的請求次數

failed requests: 0 #失敗請求

write errors: 0 #error資訊

total transferred: 333700 bytes # 總共傳輸的資料量

total posted: 36200

html transferred: 319000 bytes

requests per second: 31.66 [#/sec] (mean) #每秒處理的請求數,等於100/3.158

time per request: 157.911 [ms] (mean) #完成乙個請求的平均時間,併發數量不止乙個

time per request: 31.582 [ms] (mean, across all concurrent requests) #伺服器平均處理時間,31.582*5=157.911

transfer rate: 103.18 [kbytes/sec] received #網路傳輸速度

11.19 kb/s sent

114.38 kb/s total

# 對 time per request: 157.911的分析

connection times (ms)

min mean[+/-sd] median max

connect: 8 9 0.9 9 11

processing: 44 146 22.8 146 260

waiting: 44 145 22.7 145 260

total: 52 155 22.8 154 268

#網路請求的分布情況

percentage of the requests served within a certain time (ms)

50% 154

66% 161

75% 165

80% 168

90% 174

95% 178

98% 238

99% 268

100% 268 (longest request)

參考文獻:

1、2、

Linux壓力測試命令ab

ab是apachebench命令的縮寫。ab是apache自帶的壓力測試工具。ab非常實用,它不僅可以對apache伺服器進行 訪問壓力測試,也可以對或其它型別的伺服器進行壓力測試。比如nginx tomcat iis等 ab的原理 ab命令會建立多個併發訪問執行緒,模擬多個訪問者同時對某一url位...

ab 測試命令

ab 命令引數很多,只需要使用常用 n 執行請求次數 和 c 每次請求的請求個數 引數即可。root wubolu centos wubolu ab n 1000 c 100 this is apachebench,version 2.3 revision 655654 benchmarkingww...

Linux命令 ab 壓力測試工具

安裝 yum y install httpd tools示例 ab n 10 c 2 n 訪問次數 c 併發個數 其他引數 t 測試所進行的最大秒數 p 包含了需要post的資料的檔案 t post資料所使用的content type頭資訊 k 啟用http keepalive功能,即在乙個http...