ab是apache自帶的乙個很好用的壓力測試工具,當安裝完apache的時候,就可以在bin下面找到ab
1 我們可以模擬100個併發使用者,對乙個頁面傳送1000個請求
./ab -n1000 -c100
其中-n代表請求數,-c代表併發數
返回結果:
##首先是apache的版本資訊
this is apachebench, version 2.3 visi
on:655654
licensed to the apache software foundation,
benchmarking vm1.jianfeng.com (be patient)
server software: apache/2.2.19 ##apache版本
server hostname: vm1.jianfeng.com ##請求的機子
server port: 80 ##請求埠
document path: /a.html
document length: 25 bytes ##頁面長度
concurrency level: 100 ##併發數
time taken for tests: 0.273 seconds ##共使用了多少時間
complete requests: 1000 ##請求數
failed requests: 0 ##失敗請求
write errors: 0
total transferred: 275000 bytes ##總共傳輸位元組數,包含http的頭資訊等
html transferred: 25000 bytes ##html位元組數,實際的頁面傳遞位元組數
requests per second: 3661.60 [#/sec] (mean) ##每秒多少請求,這個是非常重要的引數數值,伺服器的吞吐量
time per request: 27.310 [ms] (mean) ##使用者平均請求等待時間
time per request: 0.273 [ms] (mean, across all concurrent requests) ##伺服器平均處理時間,也就是伺服器吞吐量的倒數
transfer rate: 983.34 [kbytes/sec] received ##每秒獲取的資料長度
connection times (ms)
min mean[+/-sd] median max
connect: 0 1 2.3 0 16
processing: 6 25 3.2 25 32
waiting: 5 24 3.2 25 32
total: 6 25 4.0 25 48
percentage of the requests served within a certain time (ms)
50% 25 ## 50%的請求在25ms內返回
66% 26 ## 60%的請求在26ms內返回
75% 26
80% 26
90% 27
95% 31
98% 38
99% 43
100% 48 (longest request)
2 ab也可以執行在windows中,如果在windows下安裝apache,就可以在bin下找到ab.exe
直接就可以使用,不用依賴其他的dll
c:\users\nickyjf\desktop\useful>ab -n1000 -c100
this is apachebench, version 2.3 visi
on:655654
licensed to the apache software foundation,
benchmarking sports.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: apache/2.0.63
server hostname: sports.sina.com.cn
server port: 80
document path: /k/2011-05-24/12095590365.shtml
document length: 86680 bytes
concurrency level: 100
time taken for tests: 66.453 seconds
complete requests: 1000
failed requests: 0
write errors: 0
total transferred: 87135790 bytes
html transferred: 86680000 bytes
requests per second: 15.05 [#/sec] (mean)
time per request: 6645.294 [ms] (mean)
time per request: 66.453 [ms] (mean, across all concurrent requests)
transfer rate: 1280.51 [kbytes/sec] received
connection times (ms)
min mean[+/-sd] median max
connect: 1 56 398.3 2 3003
processing: 89 6331 2603.7 6293 14626
waiting: 2 1748 1485.9 1590 6284
total: 90 6388 2615.0 6302 14627
percentage of the requests served within a certain time (ms)
50% 6302
66% 7121
75% 8435
80% 9193
90% 9231
95% 9385
98% 11549
99% 12459
100% 14627 (longest request)
3 apache的ab工具也算是一種ddos攻擊工具
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,...