webbench最多可以模拟3万个并发连接去测试网站的负载能力
安装:
wget
http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz cd webbench-1.5 make && make install
使用:
webbench -c 500 -t 30
http://127.0.0.1/test.jpg
参数说明:-c表示并发数,-t表示时间(秒)
结果:
web# webbench -c 500 -t 30
http://10.122.82.243:/news/index.php
Webbench - Simple Web Benchmark 1.5 Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET
http://10.122.82.243:/news/index.php
500 clients, running 30 sec.
Speed=1274 pages/min, 566020 bytes/sec.
Requests: 637 susceed, 0 failed. |
网站压力测试工具 webbench 安装配置
转自:http://www.reistlin.com/blog/84
参考文章:http://blog.s135.com/post/288/(张宴)
官方网站:http://home.tiscali.cz/~cz210552/webbench.html
1,下载,解压缩
reistlin:~# wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz reistlin:~# tar zxvf webbench-1.5.tar.gz reistlin:~# cd webbench-1.5
2,配置编译文件:Makefile 自定义安装路径
reistlin:~# vim Makefile # 自定义安装路径,默认安装路径:/usr/local/ PREFIX?= /home/reistlin/webbench
3,安装 ctags
reistlin:~# apt-get install ctags
或者下载 ctags-5.8.tar.gz 编译安装
reistlin:~# wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
注意!如果不安装 ctags make 编译会报错:/bin/sh: ctags: command not found
ctags *.c /bin/sh: ctags: command not found make: [tags] Error 127 (ignored)
4,编译,编译安装
reistlin:~# make reistlin:~# make install
5,make install 如果出现错误提示:No such file or directory
install -m 644 webbench.1 /home/reistlin/webbench/man/man1 install: cannot create regular file `/home/reistlin/webbench/man/man1': No such file or directory make: *** [install] Error 1
使用 mkdir -p 手动建立目录:
reistlin:~# mkdir -p /home/reistlin/webbench/man/man1
最后,重新执行 make install 完成安装。
建议,为方便以后调用,可以做一个 symbolic links:
reistlin:/home/reistlin/webbench# ln -s ./bin webbench
6,网站,Web压力测试:
reistlin:~# ./webbench -c 500 -t 30 http://www.reistlin.com/ Webbench - Simple Web Benchmark 1.5 Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software. Benchmarking: GET http://www.reistlin.com/ 500 clients, running 30 sec. Speed=122530 pages/min, 1065157 bytes/sec. Requests: 61259 susceed, 6 failed.
e Software. Benchmarking: GET http://www.reistlin.com/ 500 clients, running 30 sec. Speed=122530 pages/min, 1065157 bytes/sec. Requests: 61259 susceed, 6 failed.
本文转自holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/525102