Webbench是知名的网站压力测试工具,它是由Lionbridge公司(http://www.lionbridge.com)开发。

官网地址:http://home.tiscali.cz/~cz210552/webbench.html

webbench最多可以模拟3万个并发连接去测试网站的负载能力

注意:
好像不能测试HTTPS!!帮助命令里也没有相关HTTPS的帮助

webbench 做压力测试时,该软件自身也会消耗CPU和内存资源,为了测试准确,请将 webbench 安装在别的服务器上。


#安装
yum install -y gcc ctags ##需要GCC支持
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

使用


webbench -c 10 -t 10 http://jerryblog.cn/index.php #不支持https

webbench -c 并发数 -t 运行测试时间 URL

Pages/min:响应请求数/分
bytes/sec:传输数据量/秒

循环测试

for n in seq 5 5 50
do
echo -n $n " "
webbench -c $n -t 60 http://xxx.com/test.php 2>/dev/null | grep Speed | awk '{print $1}' | awk -F= '{print $2}'
echo
done

webbench --help
webbench [option]... URL
-f|--force Don't wait for reply from server.
-r|--reload Send reload request - Pragma: no-cache.
-t|--time Run benchmark for seconds. Default 30.
-p|--proxy Use proxy server for request.
-c|--clients Run 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.