<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    瘋狂

    STANDING ON THE SHOULDERS OF GIANTS
    posts - 481, comments - 486, trackbacks - 0, articles - 1
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    apache性能測試工具ab

    Posted on 2011-12-13 14:36 瘋狂 閱讀(1094) 評論(0)  編輯  收藏 所屬分類: java性能apache項目
    Apache自帶的測試工具ab(apache benchmark)在apache的bin目錄下。
    使用格式: ./ab [options] [http://]hostname[:port]/path
    參數說明:
        -n requests     Number of requests to perform
        //在測試會話中所執行的請求個數。默認時,僅執行一個請求
        -c concurrency Number of multiple requests to make
        //一次產生的請求個數。默認是一次一個。
        -t timelimit    Seconds to max. wait for responses
        //測試所進行的最大秒數。其內部隱含值是-n 50000。它可以使對服務器的測試限制在一個固定的總時間以內。默認時,沒有時間限制。
        -p postfile     File containing data to POST
        //包含了需要POST的數據的文件.
        -T content-type Content-type header for POSTing
        //POST數據所使用的Content-type頭信息。
        -v verbosity    How much troubleshooting info to print
        //設置顯示信息的詳細程度 - 4或更大值會顯示頭信息, 3或更大值可以顯示響應代碼(404, 200等), 2或更大值可以顯示警告和其他信息。 -V 顯示版本號并退出。
        -w              Print out results in HTML tables
        //以HTML表的格式輸出結果。默認時,它是白色背景的兩列寬度的一張表。
        -i              Use HEAD instead of GET
       // 執行HEAD請求,而不是GET。
        -x attributes   String to insert as table attributes
        //
        -y attributes   String to insert as tr attributes
        //
        -z attributes   String to insert as td or th attributes
        //
        -C attribute    Add cookie, eg. 'Apache=1234. (repeatable)
        //-C cookie-name=value 對請求附加一個Cookie:行。其典型形式是name=value的一個參數對。此參數可以重復。
        -H attribute    Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
                        Inserted after all normal header lines. (repeatable)
        -A attribute    Add Basic WWW Authentication, the attributes
                        are a colon separated username and password.
        -P attribute    Add Basic Proxy Authentication, the attributes
                        are a colon separated username and password.
        //-P proxy-auth-username:password 對一個中轉代理提供BASIC認證信任。用戶名和密碼由一個:隔開,并以base64編碼形式發送。無論服務器是否需要(即, 是否發送了401認證需求代碼),此字符串都會被發送。
        -X proxy:port   Proxyserver and port number to use
        -V              Print version number and exit
        -k              Use HTTP KeepAlive feature
        -d              Do not show percentiles served table.
        -S              Do not show confidence estimators and warnings.
        -g filename     Output collected data to gnuplot format file.
        -e filename     Output CSV file with percentages served
        -h              Display usage information (this message)
        //-attributes 設置 屬性的字符串. 缺陷程序中有各種靜態聲明的固定長度的緩沖區。另外,對命令行參數、服務器的響應頭和其他外部輸入的解析也很簡單,這可能會有不良后果。它沒有完整地實現HTTP/1.x; 僅接受某些'預想'的響應格式。 strstr(3)的頻繁使用可能會帶來性能問題,即, 你可能是在測試ab而不是服務器的性能。

    參數很多,一般我們用 -c 和 -n 參數就可以了. 例如:

    ./ab -c 1000 -n 1000 http://10.88.15.77/test.php

    這個表示同時處理1000個請求并運行1000次index.php文件.
    #ab -c 1000 -n 1000 http://10.88.15.77/test.php


    Benchmarking 10.88.15.77 (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:        Apache/2.2.8
    //平臺apache 版本2.2.8
    Server Hostname:        10.88.15.77
    //服務器主機名
    Server Port:            80
    //服務器端口

    Document Path:          /test.php

    //測試的頁面文檔
    Document Length:        1018 bytes
    //文檔大小

    Concurrency Level:      1000
    //并發數
    Time taken for tests:   8.188731 seconds
    //整個測試持續的時間
    Complete requests:      1000
    //完成的請求數量
    Failed requests:        0
    //失敗的請求數量
    Write errors:           0

    Total transferred:      1361581 bytes
    //整個場景中的網絡傳輸量
    HTML transferred:       1055666 bytes
    //整個場景中的HTML內容傳輸量
    Requests per second:    122.12 [#/sec] (mean)
    //大家最關心的指標之一,相當于 LR 中的 每秒事務數 ,后面括號中的 mean 表示這是一個平均值
    Time per request:       8188.731 [ms] (mean)
    //大家最關心的指標之二,相當于 LR 中的 平均事務響應時間 ,后面括號中的 mean 表示這是一個平均值
    Time per request:       8.189 [ms] (mean, across all concurrent requests)
    //每個請求實際運行時間的平均值
    Transfer rate:          162.30 [Kbytes/sec] received
    //平均每秒網絡上的流量,可以幫助排除是否存在網絡流量過大導致響應時間延長的問題

    Connection Times (ms)
                  min mean[+/-sd] median   max
    Connect:        4 646 1078.7     89    3291
    Processing:   165 992 493.1    938    4712
    Waiting:      118 934 480.6    882    4554
    Total:        813 1638 1338.9   1093    7785
    //網絡上消耗的時間的分解,各項數據的具體算法還不是很清楚

    Percentage of the requests served within a certain time (ms)
    50%   1093
    66%   1247
    75%   1373
    80%   1493
    90%   4061
    95%   4398
    98%   5608
    99%   7368
    100%   7785 (longest request)
    //整個場景中所有請求的響應情況。在場景中每個請求都有一個響應時間,其中50%的用戶響應時間小于1093 毫秒,60% 的用戶響應時間小于1247 毫秒,最大的響應時間小于7785 毫秒

          由于對于并發請求,cpu實際上并不是同時處理的,而是按照每個請求獲得的時間片逐個輪轉處理的,所以基本上第一個Time per request時間約等于第二個Time per request時間乘以并發請求數
    轉自:http://blog.sina.com.cn/s/blog_3c9872d00100dbox.html

    主站蜘蛛池模板: 亚洲综合日韩久久成人AV| 67pao强力打造高清免费| 亚洲av乱码中文一区二区三区| 亚洲国产精品无码久久久| 国产 亚洲 中文在线 字幕| 国产精品亚洲专一区二区三区| 一级特黄录像免费播放中文版| 亚洲国产精品免费视频| 最近的中文字幕大全免费版| 夜夜嘿视频免费看| 亚洲色偷偷综合亚洲AVYP| 亚洲人成电影网站| 一级毛片完整版免费播放一区| 全部免费a级毛片| 久久久久久亚洲Av无码精品专口 | 西西人体44rt高清亚洲| 中国china体内裑精亚洲日本| 日韩精品成人无码专区免费| 亚洲精品高清国产一线久久| 亚洲爆乳大丰满无码专区| 暖暖日本免费中文字幕| 亚洲国产精品成人一区| 亚洲黄色免费电影| 久久久精品午夜免费不卡| 免费一区二区视频| 精品人妻系列无码人妻免费视频| 国产va精品免费观看| 亚洲Av无码专区国产乱码DVD| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 亚洲一区中文字幕久久| 老司机在线免费视频| 久久亚洲AV午夜福利精品一区| 2021在线观看视频精品免费| 在线精品亚洲一区二区| 免费不卡视频一卡二卡| 国产成人综合亚洲绿色| 久久精品国产96精品亚洲| 免费无码AV电影在线观看| yellow免费网站| 亚洲国产日产无码精品| 亚洲成av人片在线观看天堂无码|