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

posted @ 2020-04-18 18:15  Rogn  阅读(4945)  评论(0编辑  收藏  举报