参考文章: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.