Linux下Web效能壓力測試工具http_load使用教程_伺服器其它

來源:互聯網
上載者:User

http_load介紹:
http_load基於linux平台的一種效能測工具。以並行複用的方式運行,用以測試web伺服器的輸送量與負載,測試web頁面的效能。

下載及安裝:

wget http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz
tar xzvf http_load-12mar2006.tar.gz
cd http_load-12mar2006/
make && make install

http_load參數說明:
通常參數組合:-p –f;-r -s
-p 並發訪問進程數
-f 總的訪問次數
-r 每秒的訪問頻率
-s 總的訪問時間
urlstxt 是你要訪問的網址名,參數可以是單個的網址也可以是包含網址的檔案。通常使用為包含網址的檔案,檔案格式是每行一個url,url最好超過50個,測試效果比較好。

http_load用法:
建立url.txt,添加連結:
http://www.jb51.net/category/php/
http://www.jb51.net/php/iterate-algorithm.html
http://www.jb51.net/tag/web-safe/
http://timestamp.jb51.net/

執行操作:
使用5個進程,隨機訪問url.txt網址列表,總共訪問1000次
http_load -p 5 -f 1000 url.txt

返回結果:
1000 fetches, 5 max parallel, 7.8623e+06 bytes, in 33.2007 seconds
7862.3 mean bytes/connection
30.1198 fetches/sec, 236811 bytes/sec
msecs/connect: 46.1447 mean, 1566.2 max, 36.343 min
msecs/first-response: 69.1901 mean, 896.374 max, 36.743 min
HTTP response codes:
  code 200 -- 212
  code 521 -- 788

解釋說明:
第一行:執行了1000個請求,最大進程數5,總計傳輸資料7.8623e+06 bytes,,已耗用時間33.2007s
第二行:每一個串連平均傳輸資料量 7.8623e+06/1000=7862.3
第三行:每秒響應請求為30.1198 ,每秒傳輸資料為236811 bytes【關注點:每秒的響應請求數(對應QTP中的每秒響應使用者數)】
第四行:每次串連平均回應時間為46.1447msecs,最大回應時間為1566.2msecs,最小回應時間為36.343msecs【關注點:每個串連的平均回應時間(對應QTP中的response time,每串連響應使用者時間)】
第六、七行:響應狀態代碼

聯繫我們

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