Apache ab 壓力測試工具

來源:互聯網
上載者:User

標籤:style   http   color   io   os   使用   ar   for   檔案   

  Apache Bin目錄下的 ab.exe(ApacheBench) 程式是專門用在做壓力測試用的軟體. ApacheBench(ab) 用來測試 apache 執行效率,專門用來執行網站伺服器的運行效能,特別是針對Apache 網站伺服器,這原本是用來檢測 Apache 網站伺服器能夠提供的效能,特別是可以看出Apache能提供每秒能送出多少網頁。

ab 使用的樣本:
  Usage: /usr/sbin/ab [options] [http[s]://]hostname[:port]/path

  ab 有很多參數,常用的有:

    -n: 總共的請求執行數,預設是1;
    -c: 並發數,預設是1;
    -p:POST時的資料檔案;
    -w: 以HTML表的格式輸出結果。

  以下是在命令列中對一個地址進行了100個並發的500次訪問(測試結果輸出到C盤test2.html,每次輸出結果會累計)。

    C:\Apache24\bin>ab -n 500 -c 100 -w http://127.0.0.1:8080/bpmv8.0/r?wf_num=D_S00
    5_J012  >>C:\test2.html
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Completed 500 requests
    Finished 500 requests

  HTML結果的輸出如下:

Server Software(伺服器名稱): Apache-Coyote/1.1
Server Hostname(伺服器網域名稱): 127.0.0.1
Server Port(伺服器連接埠): 8080
Document Path(請求路徑): /bpmv8.0/r?wf_num=D_S005_J012
Document Length(http響應本文長度): 5876 bytes
Concurrency Level(並發使用者數量): 100
Time taken for tests(請求處理完成總時間): 13.525 seconds
Complete requests(請求總數): 600
Failed requests(失敗請求數): 0
Total transferred(所有請求的響應資料長度): 3673200 bytes
HTML transferred(所有請求的響應資料本文長度): 3525600 bytes
Requests per second(吞吐率): 44.36
Transfer rate(請求在單位時間內從伺服器擷取資料的長度): 271581.45 kb/s received
Connnection Times (ms)
  min avg max
Connect: 0 0 16
Processing: 827 2164 3120
Total: 827 2164 3136

Apache ab 壓力測試工具

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.