linux下的压力测试工具webbench
安装
wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
如果出现下面错误:
ctags *.c
/bin/sh: ctags: command not found
那么
yum install ctags
或者
wget http://nchc.dl.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz
tar zxvf ctags-5.8.tar.gz
./configure
make
make install
若安装了ctags, 仍然报以下错:
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 -m 644 -p /usr/local/man/man1
测试
一般这时候安装就会成功了(在CentOS下测过,别的操作系统没试),试试:
webbench -c 500 -t 30 http://www.niubi.com/
参数说明:-c表示并发数,-t表示时间(秒),报告如下:
[root@localhost webbench-1.5]# webbench -c 500 -t 30 http://www.niubi.com/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://www.niubi.com/
500 clients, running 30 sec.
Speed=4760 pages/min, 192256 bytes/sec.
Requests: 2380 susceed, 0 failed.