apache bench測試

來源:互聯網
上載者:User

標籤:apache bench

apache bench(簡單壓力測試)

安裝:yum -y install httpd


指標:

1.吞吐率(Requests per second)

每秒處理的請求數

2.並發串連數

某個時刻伺服器承受的請求數

3.並發使用者

4.使用者平均等待時間

計算公式:處理完成所有請求數所花費的時間/ (總請求數 / 並發使用者數)

5.伺服器平均請求等待時間(Time per request: across all concurrent requests)

計算公式:處理完成所有請求數所花費的時間 / 總請求數




ab -n 9000 -c 100  http://www.mi.com/ 


Requests per second:    316.93 [#/sec] (mean)(吞吐率)

Time per request:       315.525 [ms] (mean)(使用者等待時間長度)

Time per request:       3.155 [ms] (mean, across all concurrent requests)(伺服器平均等待時間)

Transfer rate:          57635.56 [Kbytes/sec] received


ab -n 9000 -c 500  http://www.mi.com/ 

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

Time per request:       1556.825 [ms] (mean)

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

Transfer rate:          58401.75 [Kbytes/sec] received



ab -n 4000 -c 600  http://www.jd.com/ 

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

Time per request:       1988.272 [ms] (mean)

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

Transfer rate:          58411.92 [Kbytes/sec] received


ab -n 10000 -c 1000 http://master:18080/sa/

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

Time per request:       166.509 [ms] (mean)

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

Transfer rate:          62681.26 [Kbytes/sec] received



在遠程對web伺服器進行壓力測試,往往效果不理想(因為網路延時過大),建議使用內網的另一台或者多台伺服器通過內網進行測試,

這樣得出的資料,準確度會高很多。如果只有單獨的一台伺服器,可以直接本地測試,比遠程測試效果要準確。


apache bench測試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.