qileilove

          blog已經轉移至github,大家請訪問 http://qaseven.github.io/

          網站性能測試工具—ApacheBench

            對于網站性能測試來說,一般我們會使用loadrunner來實現,而它過于龐大,使我們感到有些不爽,而今天介紹的ApacheBench工具,它小而精,使用簡單,效果直觀,可以說,是比lr更好用的性能測試工具.
            下面介紹幾個概念
            1:吞吐率(Requests per second)
            服務器并發處理能力的量化描述,單位是reqs/s,指的是某個并發用戶數下單位時間內處理的請求數。某個并發用戶數下單位時間內能處理的最大請求數,稱之為最大吞吐率。
            記住:吞吐率是基于并發用戶數的。這句話代表了兩個含義,1:吞吐率和并發用戶數相關;2:不同的并發用戶數下,吞吐率一般是不同的。
            計算公式:總請求數  / 處理完成這些請求數所花費的時間,即
            Request per second = Complete requests  / Time taken for tests
            2:并發連接數(The number of concurrent connections)
            并發連接數指的是某個時刻服務器所接受的請求數目,簡單的講,就是一個會話。
            3:并發用戶數(The number of concurrent users,Concurrency Level)
            要注意區分這個概念和并發連接數之間的區別,一個用戶可能同時會產生多個會話,也即連接數。在HTTP/1.1下,IE7支持兩個并發連接,IE8支持6個并發連接,FireFox3支持4個并發連接,所以相應的,我們的并發用戶數就得除以這個基數。
            下面主要說一下它的幾個主要的參數
            運行參數
            請求為100,并發為10,命令如下:ApacheBench -n100 -c10 http://uri
            運行結果
          Benchmarking www.cnblogs.com (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
          Finished 1000 requests
          Server Software:
          Server Hostname:        www.cnblogs.com
          Server Port:            80
          Document Path:          /
          Document Length:        45373 bytes
          Concurrency Level:      10
          Time taken for tests:   45.299591 seconds
          Complete requests:      1000
          Failed requests:        0
          Write errors:           0
          Total transferred:      45679011 bytes
          HTML transferred:       45373000 bytes
          Requests per second:    22.08 [#/sec] (mean)
          Time per request:       452.996 [ms] (mean)
          Time per request:       45.300 [ms] (mean, across all concurrent requests)
          Transfer rate:          984.73 [Kbytes/sec] received
          Connection Times (ms)
          min  mean[+/-sd] median   max
          Connect:       26   44 189.5     31    3035
          Processing:    89  405 583.3    284    5190
          Waiting:       30  143 344.6     97    5031
          Total:        116  450 611.7    315    5224
          Percentage of the requests served within a certain time (ms)
          50%    315
          66%    322
          75%    331
          80%    343
          90%    408
          95%    549
          98%   3333
          99%   3375
          100%   5224 (longest request)

          posted on 2014-07-18 10:00 順其自然EVO 閱讀(254) 評論(0)  編輯  收藏 所屬分類: 測試學習專欄性能測試

          <2014年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 忻城县| 车险| 尚志市| 集贤县| 日喀则市| 宝山区| 新晃| 保康县| 株洲县| 郑州市| 邹城市| 闽侯县| 栖霞市| 化德县| 西城区| 云龙县| 珠海市| 墨竹工卡县| 连平县| 辛集市| 甘谷县| 汉源县| 安溪县| 永善县| 金湖县| 岗巴县| 冷水江市| 卓资县| 陇川县| 家居| 临泉县| 巫溪县| 太保市| 宁海县| 项城市| 蓬溪县| 大渡口区| 永平县| 大竹县| 南召县| 临澧县|