2010年4月19日星期一

网站压力测试工具webbench

FROM: 找到一款不错的网站压力测试工具webbench

webbench是 *nix 系统下一网站负载能力测试工具,它最多可以模拟 3 万个并发连接。

安装


[bash]
[root@localhost tmp]# wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
[root@localhost tmp]# tar xvzf webbench-1.5.tar.gz
[root@localhost tmp]# cd webbench-1.5
[root@localhost webbench-1.5]# make
[root@localhost webbench-1.5]# make install
[/bash]
通过webbench --help可获得各选项:

  • -f|--force 不等待请求返回。

  • -r|--reload 发送重新载入请求: Pragma: no-cache

  • -t|--time 测试时间,单位;s, 默认 30。

  • -p|--proxy server:port 使用 proxy 发送请求。

  • -c|--clients N 一次发送的请求数, 默认 1。

  • -9|--http09 使用 HTTP/0.9 协议发送请求。

  • -1|--http10 使用 HTTP/1.0 协议发送请求。

  • -2|--http11 使用 HTTP/1.1 协议发送请求。

  • --get 使用 GET 方式发送请求。



使用


[bash]
[root@localhost webbench-1.5]# webbench -c 500 -t 30 http://172.10.7.228/test/hs.php
[/bash]
测试结果:

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

Benchmarking: GET http://172.10.7.228/test/hs.php
500 clients, running 30 sec.

Speed=452878 pages/min, 174517 bytes/sec.
Requests: 10857 susceed, 215582 failed.

从请求结果中可看出,该服务器 500 个并发承受不住。

没有评论:

发表评论