Apache AB 壓力測試

2021-09-29 18:07:20 字數 2507 閱讀 7134

apache ab 壓力測試 

安裝// 安裝工具 yum install httpd-tools

使用

c 併發量

n 請求數

結果示例:

this is apachebench, version 2.3 <$revision: 655654 $>  

licensed to the apache software foundation,

completed 200 requests

completed 400 requests

completed 600 requests

completed 800 requests

completed 1000 requests

completed 1200 requests

completed 1400 requests

completed 1600 requests

completed 1800 requests

completed 2000 requests

finished 2000 requests

server software: nginx

server port: 80

document path: /envelope/data?enkey=d0hyf1or&uid=4040400&expires=1437460116&token=0f2aef4192f5374f85f844134ad14df5 #url中的根絕對路徑

document length: 138 bytes #http響應資料的正文長度

concurrency level: 1000 #併發使用者數

time taken for tests: 9.087 seconds #所有這些請求被處理完成所花費的總時間

complete requests: 2000 #總請求數量,這是我們設定的引數之一

failed requests: 0 #失敗的請求數量

write errors: 0

total transferred: 776000 bytes #所有請求的響應資料長度總和

html transferred: 276000 bytes #所有請求的響應資料中正文資料的總和

requests per second: 220.10 [#/sec] (mean) #吞吐率,計算公式:complete requests / time taken for tests

time per request: 4543.349 [ms] (mean) #使用者平均請求等待時間,計算公式:time token for tests/(complete requests/concurrency level)

time per request: 4.543 [ms] (mean, across all concurrent requests) #伺服器平均請求等待時間,計算公式:time taken for tests/complete requests,正好是吞吐率的倒數。也可以這麼統計:time per request/concurrency level

transfer rate: 83.40 [kbytes/sec] received #表示這些請求在單位時間內從伺服器獲取的資料長度,計算公式:total trnasferred/ time taken for tests,這個統計很好的說明伺服器的處理能力達到極限時,其出口寬頻的需求量。

connection times (ms)

min mean[+/-sd] median max

connect: 2 44 54.9 16 186

processing: 2069 3977 1830.1 4365 6841

waiting: 2069 3977 1830.1 4365 6841

total: 2071 4020 1879.2 4383 6982

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

50% 4383

66% 5397

75% 5878

80% 6163

90% 6578

95% 6785

98% 6903

99% 6949

100% 6982 (longest request)

#整個場景中所有請求的響應情況。在場景中每個請求都有乙個響應時間,其中50%的使用者響應時間小於4383毫秒,60% 的使用者響應時間小於5397毫秒,最大的響應時間小於6982毫秒

apache ab壓力測試

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

Apache ab壓力測試

apache手工編譯安裝 解包 安裝手工編譯軟體包 yum install gcc gcc c pcre devel pcre zlib devel make y 執行configure make編譯 make make install 安裝完成之後建立一條軟鏈結 配置apache主配置檔案 vim...

apache ab壓力測試

今天提到壓力測試,想起以前看到的ab,於是又重新查詢了下資料,並記錄了下。ab命令會建立很多的併發訪問執行緒,模擬多個訪問者同時對某一url位址進行訪問。它的測試目標是基於url的,因此,既可以用來測試apache的負載壓力,也可以測試nginx lighthttp tomcat iis等其它web...