Webbench是一款优秀的网站压力测试工具,最多可以模拟3W个并发来测试网站的负载能力。它可以对静态、动态等各种页面进行很好的测试。而且它还支持SSL安全网站的测试。

 使用环境

Linux

安装

首先下载webbench

tar -zxvf webbench-1.5.tar.gz
cd webbench
make&&make install

安装完成后,执行webbench会显示帮助信息。

[root@real-173 webbench-1.5]# ./webbench 
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.

使用

./webbench -c 200 -1 -t 10 https://www.ipaddr.host/

显示结果

Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET https://www.ipaddr.host/
200 clients, running 10 sec.

Speed=10062 pages/min, 367040 bytes/sec.
Requests: 1677 susceed, 0 failed.