Apache ab 測試介紹

2021-08-19 18:29:47 字數 2086 閱讀 5898

ab測試是業界比較流行和簡單易用的一種壓力測試工具包,本文將簡要介紹其核心使用的方法

ab是apache http server benchmarking tool的縮寫,可以用以測試http請求的伺服器效能。其是通過命令列的不同引數從而提供簡單易用的效能測試工具命令組合。

引數說明: -n 請求數量, -c 併發數量

ab  option  url-address

case 1: ab -n1000 -c10

結果資訊如下:

fantasy@fantasy-pc / $ ab -n1000 -c10

this is apachebench, version 2.3

visi

on:1796539

r ev

isio

n:1796539

licensed to the apache software foundation,

benchmarking www.sina.com.cn (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: nginx

server hostname: www.sina.com.cn

server port: 80

document path: /index.html

document length: 21831 bytes

concurrency level: 10

time taken for tests: 1.625 seconds

complete requests: 1000

failed requests: 0

total transferred: 22403053 bytes

html transferred: 21831000 bytes

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

time per request: 16.253 [ms] (mean)

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

transfer rate: 13461.12 [kbytes/sec] received

connection times (ms)

min mean[+/-sd] median max

connect: 3 4 1.1 4 17

processing: 8 12 7.5 10 80

waiting: 4 7 6.7 6 73

total: 11 16 7.8 14 84

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

50% 14

66% 15

75% 15

80% 16

90% 20

95% 26

98% 37

99% 65

100% 84 (longest request)

參考資料

我們可以依照上面的示例 ,去測試不同** 做出比較

開源效能測試工具 Apache ab 介紹

引子 按照原定計畫,今天開始研究 jmeter 一天的時間看完了大半的 user manual 發現原來只要沉住氣,學習效率還是蠻高的,而且大堆的英文文件也沒有那麼可怕 本來想順便把文件翻譯一下,不過後來想了想,看懂是一回事,全部翻譯出來又是另外一回事了,工作量太大,而且這也不是我一開始要研究 jm...

apache ab壓力測試

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

apache ab測試說明

轉載至 最近在做webservices,得到的資料是從德國那邊的伺服器。要將這些資料整合到現在 中去。不知道效能如何。就做個壓力測試。現在有些壓力測試工具都是收費的。在開源的apache中自帶個ab工具。就在c apache2.最近在做webservices,得到的資料是從德國那邊的伺服器。要將這些...