说明:
webbench最多可以模拟3万个并发连接去测试网站的负载能力,比apache自带的ab压力测试工具好,安装使用也方便。
1、适用系统:linux
2、下载编译安装:
复制代码 代码示例:
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
3、使用: make && make install 报错
复制代码 代码示例:
ctags *.c
/bin/sh: ctags: command not found
make: [tags] Error 127 (ignored)
install -s webbench /usr/local/bin
install -m 644 webbench.1 /usr/local/man/man1
install: cannot create regular file `/usr/local/man/man1': No such file or directory
make: *** [install] Error 1
解决办法:
复制代码 代码示例:
[root@jbxue webbench-1.5]# mkdir /usr/local/man
[root@jbxue webbench-1.5]# make && make install
4、测试
复制代码 代码示例:
[root@jbxue webbench-1.5]# webbench -c 5000 -t 10 http://127.0.0.1/index.html
结果:
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://127.0.0.1/
phpinfo.php
500 clients, running 30 sec.
Speed=10052 pages/min, 7572446 bytes/sec.
Requests: 5026 susceed, 0 failed.