ubuntu下安装webbench

原文链接:http://fan2012.iteye.com/blog/889301

由于要搞网站压力测试就准备在ubuntu下安装webbench


首先webbench是依赖于ctags,在shell中只需输入ctags即知有没有安装,如果没有要先安装ctags
如果你的源中有ctags很容易

Shell代码  收藏代码
  1. sudo apt-get install ctags  

即可安装
我的源里没有,要手动:

Shell代码  收藏代码
  1. wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz  
  2. tar zxvf ctags-5.8.tar.gz  
  3. cd ctags-5.8  
  4. ./configure  
  5. make  
  6. sudo make install  

 
到此ctags安装完毕

下载webbench:

Shell代码  收藏代码
  1. wget http://www.linuxidc.com/system/systembak/webbench/webbench-1.5.tar.gz  
  2. tar zxvf webbench-1.5.tar.gz   
  3. make  
  4. sudo make install  

即可安装成功

其中

ctags:469K
webbench:7.5K
真的感到linux软件的强大精悍呀

用法:

Shell代码  收藏代码
  1. webbench -c 100 -t 10 http://www.iteye.com/  

  

其中:
-c表示并发数,
-t表示时间(秒)

 注意url结尾一定要加上/

安装后发现其实apache自带的ab非常好用

Shell代码  收藏代码
    1. ab -c 1000 -n 100 http://www.iteye.com/index.php  
    2. 这个表示同时处理1000个请求并运行100次index.php文件. 
原文地址:https://www.cnblogs.com/PursuitOnly/p/2824088.html