ab壓力測試常用場景

2021-09-01 10:28:42 字數 1535 閱讀 4428

ab是apache自帶的乙個很好用的壓力測試工具。常用的命令如下:

ab -n 100 -c 100 url

-n:請求次數

-c:併發次數

結果如下:

concurrency level:      100

time taken for tests: 0.28327 seconds

complete requests: 100

failed requests: 0

write errors: 0

total transferred: 251000 bytes

html transferred: 228300 bytes

requests per second: 3530.20 [#/sec] (mean)

time per request: 28.327 [ms] (mean)

time per request: 0.283 [ms] (mean, across all concurrent requests)

transfer rate: 8648.99 [kbytes/sec] received

connection times (ms)

min mean[+/-sd] median max

connect: 2 2 0.7 2 3

processing: 4 13 5.6 14 23

waiting: 3 13 5.6 13 22

total: 6 16 6.0 16 26

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

50% 16

66% 20

75% 21

80% 22

90% 24

95% 26

98% 26

99% 26

100% 26 (longest request)

[search@qt-0104 ~]$

主要關注點:

time per request:    每次請求的耗時
percentage of the requests served within a certain time (ms) 耗時百分比

50% 16

66% 20

75% 21

80% 22

90% 24

95% 26

98% 26

99% 26

100% 26 (longest request)

ab 壓力測試

apache自帶的ab的壓力測試 以前安裝好apache總是不知道該如何測試apache的效能,現在總算找到乙個測試工具了。就是apache自帶的測試工具ab apache benchmark 在apache的bin目錄下。格式 ab options http hostname port path ...

ab壓力測試

1.我的環境是windows下的phpstudy,進入到apache bin目錄裡面有個ab.exe,壓力測試命令如下 ab.exe c 200 n 1000 2.mysql.php 如下 正常的邏輯思維,壓力增大後,導致資料庫num欄位成為負數,將下面 貼上到自己 下測試即可。在test資料庫下,...

ab壓力測試

ab命令會建立多個併發訪問執行緒,模擬多個訪問者同時對某一url位址進行訪問。它的測試目標是基於url的,因此,它既可以用來測試apache的負載壓力,也可以測試nginx lighthttp tomcat iis等其它web伺服器的壓力。ab命令對發出負載的計算機要求很低,它既不會占用很高cpu,...