压力测试 ab,Siege,http_load,webbench
[ 2010/06/10 16:24 | by selboo ]
Linux下webbench压力测试
[ 2009/03/04 20:12 | by selboo ]
下载安装
[root@wpcn ~]# tar -zxvf webbench-1.5.tar.gz
[root@wpcn ~]# cd webbench-1.5
[root@wpcn webbench-1.5]# make && make install
使用方法
[root@wpcn webbench-1.5]# 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.
以下是我在vmware测试
[root@wpcn webbench-1.5]# webbench -c 300 -t 5 http://127.0.0.1/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://127.0.0.1/
300 clients, running 5 sec.
Speed=108240 pages/min, 1813374 bytes/sec.
Requests: 9020 susceed, 0 failed.
-c 300 模拟300客户端连接
-t 5 是连接5秒钟
Speed=108240 pages/min 每分钟浏览http://127.0.0.1/selboo.php 这个页面108240次
1813374 bytes/sec. 每秒1813374个字节
Requests: 9020 susceed 连接成功9020
0 failed. 失败0
在介绍一个牛命令 from:http://blog.s135.com/post/269.htm
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
返回结果示例:
LAST_ACK 5
SYN_RECV 30
ESTABLISHED 1597
FIN_WAIT1 51
FIN_WAIT2 504
TIME_WAIT 1057
TCP状态描述:
CLOSED:无连接是活动的或正在进行
LISTEN:服务器在等待进入呼叫
SYN_RECV:一个连接请求已经到达,等待确认
SYN_SENT:应用已经开始,打开一个连接
ESTABLISHED:正常数据传输状态
FIN_WAIT1:应用说它已经完成
FIN_WAIT2:另一边已同意释放
ITMED_WAIT:等待所有分组死掉
CLOSING:两边同时尝试关闭
TIME_WAIT:另一边已初始化一个释放
LAST_ACK:等待所有分组死掉
[root@wpcn ~]# tar -zxvf webbench-1.5.tar.gz
[root@wpcn ~]# cd webbench-1.5
[root@wpcn webbench-1.5]# make && make install
使用方法
[root@wpcn webbench-1.5]# webbench --help
webbench [option]... URL
-f|--force Don't wait for reply from server.
-r|--reload Send reload request - Pragma: no-cache.
-t|--time
-p|--proxy
-c|--clients
-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.
以下是我在vmware测试
[root@wpcn webbench-1.5]# webbench -c 300 -t 5 http://127.0.0.1/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://127.0.0.1/
300 clients, running 5 sec.
Speed=108240 pages/min, 1813374 bytes/sec.
Requests: 9020 susceed, 0 failed.
-c 300 模拟300客户端连接
-t 5 是连接5秒钟
Speed=108240 pages/min 每分钟浏览http://127.0.0.1/selboo.php 这个页面108240次
1813374 bytes/sec. 每秒1813374个字节
Requests: 9020 susceed 连接成功9020
0 failed. 失败0
下载文件 (已下载 409 次)
在介绍一个牛命令 from:http://blog.s135.com/post/269.htm
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
返回结果示例:
LAST_ACK 5
SYN_RECV 30
ESTABLISHED 1597
FIN_WAIT1 51
FIN_WAIT2 504
TIME_WAIT 1057
TCP状态描述:
CLOSED:无连接是活动的或正在进行
LISTEN:服务器在等待进入呼叫
SYN_RECV:一个连接请求已经到达,等待确认
SYN_SENT:应用已经开始,打开一个连接
ESTABLISHED:正常数据传输状态
FIN_WAIT1:应用说它已经完成
FIN_WAIT2:另一边已同意释放
ITMED_WAIT:等待所有分组死掉
CLOSING:两边同时尝试关闭
TIME_WAIT:另一边已初始化一个释放
LAST_ACK:等待所有分组死掉