標籤:des style http color 使用 os io strong
優點:參數少;缺點:url.txt檔案要求較高,不如siege方便
http_load是ACME實驗室開發的,這個工具以並發方式運行,用以測試web伺服器的輸送量與負載。它不同於其它壓力測試工具的是,它能以單一的進程運行,一般不會使客戶機down掉。同時在unix下,除了http它也可以用來測試https類型的請求。官方地址:http://www.acme.com/software/http_load/
安裝:
tar zxvf http_load-12mar2006.tar
cd http_load-12mar2006
make && make install /*makeinstall之間是有空格的,同時make install需要root許可權*/
參數說明:
XXXXXXXXXXXXX:~/http_load-12mar2006$http_load –help
usage: http_load [-checksum] [-throttle][-proxy host:port] [-verbose] [-timeout secs] [-sip sip_file]
-parallel N | -rate N[-jitter]
-fetches N | -seconds N
url_file /*需要訪問的URL文字檔,檔案格式是每行一個URL,URL最好超過50-100個測試效果比較好*/
One start specifier, either -parallel or -rate, is required. /*使用的時候 –parallel與-rate二選一*/
One end specifier, either -fetches or -seconds, is required. /*使用的時候 –feches與-second二選一*/
-parallel 簡寫-p :並發的使用者進程數 /*http_load –p500 –s 300 user.txt,並發500個進程,跑300秒*/
-rate 簡寫-r :每秒的訪問頻率 /*比如http_load –r 5 –s 10 url.txt,說的是每秒的訪問頻率是5次,共跑10秒*/
-fetches 簡寫-f :總計的訪問次數 /*使用fetches能讓用戶端保證確定請求數的全部處理,更容易讓被測伺服器受到壓力 */
-seconds簡寫-s :總計的訪問時間
基本使用:
XXXXXXXXXXXXX:~/http_load-12mar2006$ http_load -p 10 -s 5 urls.txt /*並發10個進程,訪問5秒。Urls.txt內的檔案格式為每行1個url地址。*/
操作結果:(測試的url.txt內的網址均為:http://www.test.com/index.html)
13995 fetches, 10max parallel, 21948 bytes, in 5 seconds /*共運行了13995個請求,最大並發進程數是10,總傳輸資料是21948個位元組,已耗用時間5秒*/
1.56827 mean bytes/connection /*21948位元組/13995請求 = 每個串連平均傳輸的資料量是1.56827個位元組*/
2799 fetches/sec, 4389.6 bytes/sec /*伺服器每秒能夠響應的查詢次數是2799個(13995/5),每秒傳遞的資料是4389.6 bytes*/
msecs/connect: 1.74836 mean, 3.757 max, 1.439 min /*每個串連的平均訪問時間是1.748毫秒*/
msecs/first-response:1.79729 mean, 5.463 max, 1.484 min /**/
HTTP responsecodes:
code 200 -- 236
討論/疑問:
- 測試結果裡的msecs/connect與msecs/first-response的差別在於?