Webbench 最多可以模拟3万个并发连接去测试网站的负载能力
1、下载和安装
cd /usr/local/
wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
安装依赖包 yum install -y man ctags
mkdir -p /usr/local/man/man1
#解压安装
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
2、使用说明
webbench -c 500 -t 30 http://127.0.0.1/test.jpg
参数说明:-c表示并发连接客户端,-t表示时间(秒)
强并发测试:
webbench -f -c 500 -t 30 http://192.168.224.31/index.html
3、Troubshooting:
1) make 时报错
在安装编译webbench的时候,
出现如下错误信息 ctags *.c/bin/sh: ctags: command not foundmake: [tags] Error 127 (ignored) 意思是说缺少ctags命令,运行以下命令即可yum install ctags
2)make install 时报错
make install
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
直接执行 mkdir -p /usr/local/man/man1 即可
