Apache ab壓力測試

Apache ab壓力測試apache

一、  本地安裝apache服務器

二、  在安裝目錄下的bin目錄雙擊ab.exe起動ab網絡

三、  在cmd執行命令併發

a)         進入apache安裝目錄下的bin目錄wordpress

b)         在bin目錄下執行壓測命令,以下:測試

D:\AppServ\Apache2.2\bin>ab -n 10 -c 5 http://120.25.105.232/wordpress/.net

# -n :總共請求數; -c:總共併發數;意思是5個用戶一共發送10個請求get

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0cmd

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/requests

Copyright 2006 The Apache Software Foundation, http://www.apache.org/

 

Benchmarking 120.25.105.232 (be patient).....done

 

 

Server Software:        Apache/2.2.15  服務器版本信息

Server Hostname:        120.25.105.232  服務器主機名

Server Port:            80  服務器端口號

 

Document Path:          /wordpress/  測試頁面的路徑

Document Length:        45892 bytes  測試頁面的大小

 

Concurrency Level:      5  全部併發用戶數

Time taken for tests:   4.584459 seconds   全部這些請求處理完成所花費的時間 

Complete requests:      10   總共完成的請求數

Failed requests:        0   失敗的請求數 

Write errors:           0

Total transferred:      461230 bytes  網絡總傳輸量

HTML transferred:       458920 bytes  HTML內容傳輸量 

Requests per second:    2.18 [#/sec] (mean)  吞吐量-每秒處理請求數=總請求數 / 處理完成這些請求數所花費的時間,即Request per second = Complete requests / Time taken for tests

Time per request:       2292.229 [ms] (mean) 平均響應時間(用戶平均請求等待時間)

Time per request:       458.446 [ms] (mean, across all concurrent requests) 服務器平均處理時間

Transfer rate:          98.16 [Kbytes/sec] received 平均每秒網絡上的流量,(傳輸速率)

 

網絡上消耗的時間的分解:

Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        4   81  97.0     88     249

Processing:  1051 1924 730.7   2123    2890

Waiting:      639  996 335.4   1074    1488

Total:       1249 2006 654.9   2129    2897

 

整個場景中全部請求的響應狀況

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

  50%   2129

  66%   2372

  75%   2711

  80%   2817

  90%   2897

  95%   2897

  98%   2897

  99%   2897

 100%   2897 (longest request)

 

10個併發,100個請求

D:\AppServ\Apache2.2\bin>ab -n 100 -c 10 http://120.25.105.232/wordpress/

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Copyright 2006 The Apache Software Foundation, http://www.apache.org/

 

Benchmarking 120.25.105.232 (be patient).....done

 

 

Server Software:        Apache/2.2.15

Server Hostname:        120.25.105.232

Server Port:            80

 

Document Path:          /wordpress/

Document Length:        45892 bytes

 

Concurrency Level:      10

Time taken for tests:   36.594659 seconds

Complete requests:      100

Failed requests:        0

Write errors:           0

Total transferred:      4612300 bytes

HTML transferred:       4589200 bytes

Requests per second:    2.73 [#/sec] (mean)         

Time per request:       3659.466 [ms] (mean)

Time per request:       365.947 [ms] (mean, across all concurrent requests)

Transfer rate:          123.08 [Kbytes/sec] received

 

Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        4  314 131.1    346    1052

Processing:  1052 3264 1086.2   3101    7664

Waiting:      490 1227 611.1   1051    3203

Total:       1450 3578 1007.7   3439    7672

 

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

  50%   3439

  66%   3449

  75%   3460

  80%   3498

  90%   4652

  95%   6368

  98%   7266

  99%   7672

 100%   7672 (longest request)

相關文章
相關標籤/搜索