Linux操作系统下webbench的安装和简单使用

Webbench:是有名的网站压力测试工具,它是由 Lionbridge公司开发。
Webbech能测试处在相同硬件上,不同服务的性能以及不同硬件上同一个服务的运行状况。webBech的标准测试可以向我们展示服务器的 两项 内容:每秒钟相应请求数和每秒钟传输数据量。webbench不但能具有便准 静态页面的测试能力,还能对 动态页面(ASP,PHP,JAVA,CGI)进 行测试的能力。还有就是他支持对含有SSL的安全网站例如电子商务网站进行 静态或动态的 性能测试。
1.使用wget命令下载安装包

wget  http://home.tiscali.cz/cz210552/distfiles/webbench-1.5.tar.gz
[root@bogon mengyao]# wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz 
--2018-09-17 08:37:55--  http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
Resolving blog.s135.com... 47.52.239.206
Connecting to blog.s135.com|47.52.239.206|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://zyan.cc/soft/linux/webbench/webbench-1.5.tar.gz [following]
--2018-09-17 08:37:56--  http://zyan.cc/soft/linux/webbench/webbench-1.5.tar.gz
Resolving zyan.cc... 47.52.239.206
Reusing existing connection to blog.s135.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 7675 (7.5K) [application/octet-stream]
Saving to: “webbench-1.5.tar.gz”

100%[===================================================================================================================>] 7,675       --.-K/s   in 0.002s  

2018-09-17 08:37:56 (4.09 MB/s) - “webbench-1.5.tar.gz” saved [7675/7675]

2.解压安装包
tar -zvxf webbench-1.5.tar.gz
cd webbench-1.5

[root@bogon mengyao]# tar zxvf webbench-1.5.tar.gz
webbench-1.5/
webbench-1.5/webbench.1
webbench-1.5/socket.c
webbench-1.5/webbench.c
webbench-1.5/Makefile
webbench-1.5/debian/
webbench-1.5/debian/rules
webbench-1.5/debian/dirs
webbench-1.5/debian/copyright
webbench-1.5/debian/control
webbench-1.5/debian/changelog
webbench-1.5/COPYRIGHT
webbench-1.5/ChangeLog

  1. cd webbench-1.5
    make编译&&make install编译安装
    当出现如下这种状况编译失败是因为没有清除干净,此时应当输入make clean再进行make然后make install
[root@bogon webbench-1.5]# make
make: Nothing to be done for `all'.
[root@bogon webbench-1.5]# make clean
rm -f *.o webbench *~ core *.core tags
[root@bogon webbench-1.5]# make
cc -Wall -ggdb -W -O   -c -o webbench.o webbench.c
webbench.c: In function ‘alarm_handler’:
webbench.c:77: warning: unused parameter ‘signal’
cc -Wall -ggdb -W -O  -o webbench webbench.o  
ctags *.c
[root@bogon webbench-1.5]# make install
install -s webbench /usr/local/bin	
install -m 644 webbench.1 /usr/local/man/man1	
install -d /usr/local/share/doc/webbench
install -m 644 debian/copyright /usr/local/share/doc/webbench
install -m 644 debian/changelog /usr/local/share/doc/webbench

  1. 安装成功(在命令行输入webbench,显示出参数用法就说明已经安装成功了,也可以用webbench --version查看版本号看是否安装成功)
[root@bogon webbench-1.5]# webbench
webbench [option]... URL
  -f|--force               Don't wait for reply from server.
  -r|--reload              Send reload request - Pragma: no-cache.
  -t|--time           Run benchmark for  seconds. Default 30.
  -p|--proxy  Use proxy server for request.
  -c|--clients          Run  HTTP clients at once. Default one.
  -9|--http09              Use HTTP/0.9 style requests.
  -1|--http10              Use HTTP/1.0 protocol.
  -2|--http11              Use HTTP/1.1 protocol.
  --get                    Use GET request method.
  --head                   Use HEAD request method.
  --options                Use OPTIONS request method.
  --trace                  Use TRACE request method.
  -?|-h|--help             This information.
  -V|--version             Display program version.

  1. 使用方法:
    测试并发送请求webbench -c 10 http://baidu.com/
    Linux操作系统下webbench的安装和简单使用_第1张图片
    Speed:每分钟的处理6552个请求;每秒的处理数据量:6502字节
    Requests:处理的请求中成功512,失败0.
    总结:
    webbench和apache自带的HTTP的性能测试工具ab类似,都是web测试工具,
    这两款都能够对web链接进行方便的测试,而且只限于对独立的链接分别测试。因此对于需要和服务器的交互测试就比较困难了。

你可能感兴趣的:(Linux操作系统,随笔)