网站压力测试工具 webbench 安装配置

时间:2021-09-16 01:34:18

http://blog.csdn.net/cnbird2008/article/details/6072428

参考文章:http://blog.s135.com/post/288/(张宴)
官方网站:http://home.tiscali.cz/~cz210552/webbench.html

1,下载,解压缩

[text] view plaincopyprint?
  1. reistlin:~# wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz  
  2. reistlin:~# tar zxvf webbench-1.5.tar.gz  
  3. reistlin:~# cd webbench-1.5  

2,配置编译文件:Makefile 自定义安装路径

[text] view plaincopyprint?
  1. reistlin:~# vim Makefile  
  2.    
  3. # 自定义安装路径,默认安装路径:/usr/local/  
  4. PREFIX?= /home/reistlin/webbench  

3,安装 ctags

[text] view plaincopyprint?
  1. reistlin:~# apt-get install ctags  

或者下载 ctags-5.8.tar.gz 编译安装

[text] view plaincopyprint?
  1. reistlin:~# wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz  

注意!如果不安装 ctags make 编译会报错:/bin/sh: ctags: command not found

[text] view plaincopyprint?
  1. ctags *.c  
  2. /bin/sh: ctags: command not found  
  3. make: [tags] Error 127 (ignored)  

4,编译,编译安装

[text] view plaincopyprint?
  1. reistlin:~# make  
  2. reistlin:~# make install  

5,make install 如果出现错误提示:No such file or directory

[text] view plaincopyprint?
  1. install -m 644 webbench.1 /home/reistlin/webbench/man/man1  
  2. install: cannot create regular file `/home/reistlin/webbench/man/man1': No such file or directory  
  3. make: *** [install] Error 1  

使用 mkdir -p 手动建立目录:

[text] view plaincopyprint?
  1. reistlin:~# mkdir -p /home/reistlin/webbench/man/man1  

最后,重新执行 make install 完成安装。

建议,为方便以后调用,可以做一个 symbolic links

[text] view plaincopyprint?
  1. reistlin:/home/reistlin/webbench# ln -s ./bin webbench  

6,网站,Web压力测试:

[text] view plaincopyprint?
  1. reistlin:~# ./webbench -c 500 -t 30 http://www.reistlin.com/  
  2.    
  3. Webbench - Simple Web Benchmark 1.5  
  4. Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.  
  5.    
  6. Benchmarking: GET http://www.reistlin.com/  
  7. 500 clients, running 30 sec.  
  8.    
  9. Speed=122530 pages/min, 1065157 bytes/sec.  
  10. Requests: 61259 susceed, 6 failed.