apache自帶性能測試工具ab

最近研究APACHE的優化問題,發現 ab 這東東還是不錯的,可爲衡量APACHE性能提供一些有價值的參考依據。

./ab -n 50000 -c 1000  http://localhost/bbs/index.php

//這個表示1000個用戶 發送 50000請求 index.php文件的動作,服務器的處理情況如下: 


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  localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Finished 50000 requests
 
Server Software:        Apache/2.2.3                     //平臺apache 版本 2.2.3
Server Hostname:        localhost                   //服務器主機名
Server Port: 80                                     //服務器端口
Document Path: /bbs/index.php                 //測試的頁面文檔
Document Length: 303 bytes                  //文檔大小
Concurrency Level: 1000                        //併發數
Time taken for tests:   37.468807 seconds                    //整個測試持續的時間
Complete requests:      50000              //完成的請求總數
Failed requests: 0                                 //失敗的請求數量
Write errors: 0                              //讀寫錯誤的請求數量
Non-2xx responses:      50092                    //正常響應請求的總數
Total transferred:      26198116 bytes                 //整個場景中的網絡傳輸量
HTML transferred:       15177876 bytes                //整個場景中的HTML內容傳輸量
Requests per second:    1334.44 [#/sec] (mean)
//關鍵指標之一,相當於 LR 中的 每秒事務數 ,後面括號中的 mean 表示這是一個平均值
Time per request:       749.376 [ms] (mean)
//大家最關心的指標之二,相當於 LR 中的 平均事務響應時間 ,後面括號中的 mean 表示這是一個平均值
Time per request:       0.749 [ms] (mean, across all concurrent requests)
//每個請求實際運行時間的平均值
Transfer rate:          682.81 [Kbytes/sec] received
//平均每秒網絡上的流量,可以幫助排除是否存在網絡流量過大導致響應時間延長的問題Connection Times (ms)
                         min  mean[+/-sd] median   max
Connect:           0    14 168.2                 3        3015
Processing:     0    191 1794.0             35      37423
Waiting:           0    178 1795.1             15       37421
Total:               9    206 1804.8            37         37461
//網絡上消耗的時間的分解
 
Percentage of the requests served within a certain time (ms)
  50%     37
  66%     43
  75%     46
  80%     48
  90%     53
  95%     58
  98%    263
  99%   3000
 100%  37461 (longest request)
//整個場景中所有請求的響應情況。在場景中每個請求都有一個響應時間,其中50%的用戶響應時間小於37 毫秒,66% 的用戶響應時間小於43 毫秒,最大的響應時間小於37461 毫秒 。

備註:APACHE官網上關於AB的介紹:http://httpd.apache.org/docs/2.0/programs/ab.html  

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章