httperf ---linux web站點壓力測試

1、工具下載&&安裝 
軟件獲取 html

ftp://ftp.hpl.hp.com/pub/httperf/ 
這裏使用的是以下的版本 
ftp://ftp.hpl.hp.com/pub/httperf/httperf-0.9.0.tar.gz 
軟件安裝 
# ls httperf-0.9.0.tar.gz  
httperf-0.9.0.tar.gz 
#tar zxvf httperf-0.9.0.tar.gz  && cd httperf-0.9.0 &&./configure  --prefix=/usr/local/tools && make && make install 
 
2、開始壓力測試 
 
[root@localhost bin]# ./httperf --client=0/1 --server www.ethnicity.cn --port80 --uri /index.html --rate 100 --num-conn 300 --num-call 5 --timeout 5 網絡

  • --client=I/N 指定當前客戶端I,是N個客戶端中的第幾個。用於多個客戶端發請求,但願確保每一個客戶端發的請求不是徹底一致。通常不用指定併發

  • --server 所測試的的網站名(主機名,域名或者ip地址)socket

  • --uri 指定的下載文件工具

  • --rate  每秒發送的請求測試

  • --num-conn 鏈接的總數網站

  • --num-call 每一個鏈接發送的請求數目spa

  • --timeout 超時時間server

httperf --timeout=5 --client=0/1--server=www.ethnicity.cn --port=80 --uri=/index.html --rate=100 --send-buffer=4096--recv-buffer=16384 --num-conns=300 --num-calls=5 
Maximum connect burst length: 13htm

  • 最大併發鏈接數:13

Total: connections 300 requests 1475 replies 1475test-duration 6.204 s

  • 一共300個鏈接,1475個請求,應答了1475個,測試耗時:6.204秒

Connection rate: 48.4 conn/s (20.7 ms/conn, <=189concurrent connections)

  • 鏈接速率:48.4個每秒(每一個鏈接耗時20.7 ms, 小於指定的300個併發鏈接)

Connection time [ms]: min 663.4 avg 1937.6 max 3808.4median 1720.5 stddev 964.7

  • 鏈接時間(微秒):最小663.4,平均1937.6,最大3808.4,中位數 1720.5, 標準誤差964.7

Connection time [ms]: connect 1098.4

  • 鏈接時間(微秒):鏈接1098.4

Connection length [replies/conn]: 5.000

  • 鏈接長度(應答/鏈接):5.000

Request rate: 237.7 req/s (4.2 ms/req)

  • 請求速率:237.7(pqs),每一個請求4.2 ms

Request size : 79.0

  • 鏈接長度(應答/鏈接): 79.0

Reply rate [replies/s]: min 268.8 avg 268.8 max 268.8stddev 0.0 (1 samples)

  • 響應速率(響應個數/秒):最小268.8, 平均268.8,最大268.8,標準誤差 0.0(一個例樣)

Reply time [ms]: response 80.7 transfer 87.2

  • 響應時間(微妙):響應80.7,傳輸87.2

Reply size : header 283.0 content 21895.0 footer 0.0(total 22178.0)

  • 應包長度(字節):響應頭283.0 內容:21895.0 響應末端 -0.0(總共22178.0)

Reply status: 1xx=0 2xx=1475 3xx=0 4xx=0 5xx=0

  • 響應包狀態: 2xx 有1475個,其餘沒有

CPU time [s]: user 0.45 system 5.48 (user 7.3% system88.3% total 95.6%)

  • CPU時間(秒): 用戶0.45 系統5.48(用戶佔了7.3% 系統佔88.3% 總共95.6%)

Net I/O: 5167.4 KB/s (42.3*10^6 bps)

  • 網絡I/O:5167.4 KB/s

Errors: total 5 client-timo 5 socket-timo 0 connrefused 0connreset 0

  • 錯誤:總數5 客戶端超時5 套接字超時0 鏈接拒絕0 鏈接重置0

Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

    • 錯誤:fd不正確0 地址不正確0 ftab佔滿0其餘0

相關文章
相關標籤/搜索