Web性能壓力測試工具之WebBench詳解


webbench的標准測試可以向我們展示服務器的兩項內容:每秒鍾響應請求數和每秒鍾傳輸數據量。

webbench不但能具有便准靜態頁面的測試能力,還能對動態頁面(ASP, PHP, JAVA,CGI)進 行測試的能力。
他支持對含有SSL的安全網站例如電子商務網站進行靜態或動態的性能測試。
Webbench最多可以模擬3萬個並發連接去測試網站的負載能力。
官方主頁: http://home.tiscali.cz/~cz210552/webbench. html
1、WebBench安裝
wget  http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
tar -zxvf webbench-1.5.tar.gz
cd webbench-1.5
make
make install

安裝中遇到的問題及解決方法

ctags *.c 
/bin/sh: ctags: command not found 
make: [tags] Error 127 (ignored) 

意思是缺少ctags命令,用apt install ctags安裝即可。

2、測試WebBench

webbench

webbench [option]... URL
  -f|--force               Don't wait for reply from server.
  -r|--reload              Send reload request - Pragma: no-cache.
  -t|--time <sec>          運行測試時間  Run benchmark for <sec> seconds. Default 30.
  -p|--proxy <server:port> Use proxy server for request.
  -c|--clients <n>         並發數  Run <n> HTTP clients at once. Default one.
  -9|--http09              Use HTTP/0.9 style requests.
  -1|--http10              Use HTTP/1.0 protocol.
  -2|--http11              Use HTTP/1.1 protocol.
  --get                    Use GET request method.
  --head                   Use HEAD request method.
  --options                Use OPTIONS request method.
  --trace                  Use TRACE request method.
  -?|-h|--help             This information.
  -V|--version             Display program version.

3、進行測試

webbench -c 1000 -t 60 http://192.168.80.157/phpinfo.php
每秒鍾響應請求數:24525 pages/min,每秒鍾傳輸數據量20794612 bytes/sec.
並發1000運行60秒后產生的TCP連接數12000多個,已經顯示有87個連接failed了,說明超負荷了。

 

參考鏈接:https://www.jianshu.com/p/97e4d312e83d


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM