近期在做 压力測试工具,除了apache的ab測试工具外,发现webbentch工具也不错,这里简介下这两个工具。

一、webbentch安装:

wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz

    tar zxvf webbench-1.5.tar.gz

    cd webbench-1.5

    make && make install

假设没有安装ctags。则安装的时候会报错。ctags的安装:

apt-get install ctags

或者依照以下的步骤进行手动安装:

wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz

   tar zxvf ctags-5.8.tar.gz

   cd ctags-5.8

   ./configure

   make && make install

二、webbentch使用:

  測试原理:指定client的并发数和运行时间。查看server发出的请求中susceed的个数和failed的个数

使用命令:webbentch -c 10000 -t 60 http://xx.xx.xx.156:8082/index.html

-c: 发起请求的client数,也就是我们所说的并发数

-t:运行时间长度

运行结果例如以下:

Webbench - Simple Web Benchmark 1.5

Requests: 1033020 susceed, 5 failed.

Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.



  Benchmarking: GET http://10.103.13.156:8082/index.html

  10000 clients, running 60 sec.

                                                                                                

  Speed=1033025 pages/min, 3856600 bytes/sec.

Requests: 1033020 susceed, 5 failed.

三、apache的ab使用:

測试原理:指定client的并发数和请求总量。计算server每秒能够处理的请求数和每一个请求响应的时间

使用命令:ab -c 10000 -n 80000 http://xx.xx.xx.156:8082/index.html

-c : 发起请求的client数。也就是我们所说的并发数

-n:发起的总请求数

运行结果例如以下:

须要关心的几个參数:Requests per second、Time per request

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/



Benchmarking 10.103.13.156 (be patient)

Completed 8000 requests

Completed 16000 requests

Completed 24000 requests

Completed 32000 requests

Completed 40000 requests

Completed 48000 requests

Completed 56000 requests

Completed 64000 requests

Completed 72000 requests

Completed 80000 requests

Finished 80000 requests





Server Software:        nginx                                             //webserver

Server Hostname:        xx.xx.xx.156                             //webserver地址

Server Port:            8082                                                //webserverport



Document Path:          /index.html                                //请求地址

Document Length:        2 bytes                                    //返回的数据长度



Concurrency Level:      10000                                      //设置的并发数,就是-c设置的值

Time taken for tests:   13.691 seconds                       //全部请求运行完毕所耗费的时间

Complete requests:      80000                                      //完毕的请求数

Failed requests:        0                                                    //失败的请求数

Total transferred:      17920000 bytes                         //传递数据的大小,包含header的信息

HTML transferred:       160000 bytes                           //传递的html的大小。这里的数字等于   (Document Length)  *  (Complete requests)

Requests per second:    5843.27 [#/sec] (mean)      //美妙的请求数,也就是我们server能够承受的实际并发数,即通常所受的rps

Time per request:       1711.371 [ms] (mean)             //每一个请求的响应时间,mean表示是平均值

Time per request:       0.171 [ms] (mean, across all concurrent requests)   //每一个请求的时间。等于   (Time taken for tests * 1000ms) / Complete requests

Transfer rate:          1278.22 [Kbytes/sec] received    //每秒传输的数据量。能够计算是否是带宽的影响



Connection Times (ms)                                                    //时间的统计

              min  mean[+/-sd] median   max

Connect:        2  156 486.3     18    4700

Processing:    12  240 920.8     19   12024

Waiting:       12  240 920.8     18   12024

Total:         29  396 1098.9     37   13050



Percentage of the requests served within a certain time (ms)

  50%     37                             //37毫秒响应了37%的请求

  66%     45                             //45毫秒响应了66%的请求

  75%    143                            //143毫秒响应了75%的请求,以下的以此类推

  80%    258

  90%   1035

  95%   3034

  98%   3702

  99%   6029

 100%  13050 (longest request)



三、注意事项:

在使用webbentch和apache的ab进行压力測试的时候,假设測试的url地址中有多个參数,须要对url中的"&"符号进行转义,输入“\&”就可以;把"&"=>"%26"是没有效果的。

如url为  http://xx.xx.xx.156:8080/info.php?

p1=v1&p2=v2&p3=v3

转换后   http://xx.xx.xx.156:8080/info.php?p1=v1\&p2=v2\&p3=v3

ubuntu 14.04 LTS 安装webbentch压力測试工具的更多相关文章

  1. ubuntu 14.04 lts安装教程:u盘安装ubuntu 14.04 lts步骤

    绿茶小编带来了ubuntu 14.04 lts安装教程,下文详细讲解了u盘安装ubuntu 14.04 lts的步骤,很简单,只需要一个工具就能够轻松使用u盘安装ubuntukylin 14.04系统 ...

  2. Ubuntu 14.04 LTS 安装和配置Bochs

    Ubuntu 14.04 LTS 安装和配置Bochs       系统是:Ubuntu 14.04 LTS 64位 安装的是:bochs-2.6.8 Bochs 需要在 X11 环境下运行,因此你的 ...

  3. Ubuntu 14.04 LTS 安装Docker

    Docker官方是有很详细的安装文档(https://docs.docker.com/engine/installation/ubuntulinux/),这里做了一个Ubuntu 14.04 LTS中 ...

  4. Ubuntu 14.04 LTS 安装Docker(转)

    转自:https://www.cnblogs.com/leolztang/p/5097278.html Docker官方是有很详细的安装文档(https://docs.docker.com/engin ...

  5. Ubuntu 14.04 LTS 安装 Juno 版 OpenStack Keystone

    本文介绍如何在Ubuntu 14.04 LTS 上安装Juno版的Keystone, 我们采用的是手动安装的方式, 同时仅针对OpenStack的身份与访问管理系统Keystone. 事实上OpenS ...

  6. Ubuntu 14.04 LTS 安装 spark 1.6.0 (伪分布式)-26号开始

    需要下载的软件: 1.hadoop-2.6.4.tar.gz 下载网址:http://hadoop.apache.org/releases.html 2.scala-2.11.7.tgz 下载网址:h ...

  7. Ubuntu 14.04 LTS 安装 VNC Viewer

    1.修改镜像源: /etc/apt/sources.list将"http://archive.ubuntu.com/ubuntu/"替换为: http://cn.archive.u ...

  8. Ubuntu 14.04 LTS 安装 NVIDIA 显卡驱动后的屏幕亮度调节问题

    安装 Ubuntu,对于 NVIDIA 显卡,默认情况下会使用第三方开源驱动,并且一般情况下,第三方开源驱动和系统兼容性更好.由于 NVIDIA 显卡驱动不是开放的,所以对 Linux 系统的原生支持 ...

  9. ubuntu 14.04 LTS 安装ss客户端

    附: 配置pac模式 ss客户端 ss客户端 前提环境 python (用最新的就行) pip (注:python工具) build-essential 以上可以通过一条命令解决: sudo apt- ...

随机推荐

  1. redhat linux 从/home目录扩展空间至/根目录

    查看分区大小 [root@easdb01 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/vg_easdb01-lv_ro ...

  2. 【bzoj2563】阿狸和桃子的游戏 贪心

    题目描述 阿狸和桃子正在玩一个游戏,游戏是在一个带权图G=(V, E)上进行的,设节点权值为w(v),边权为c(e).游戏规则是这样的:1. 阿狸和桃子轮流将图中的顶点染色,阿狸会将顶点染成红色,桃子 ...

  3. 移动端可拖动导航菜单小demo

    <!DOCTYPE html> <html lang="en"> <head> <title>移动端滑动导航菜单</title ...

  4. POJ——3264Balanced Lineup(RMQ模版水题)

    Balanced Lineup Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 44112   Accepted: 20713 ...

  5. [CQOI2010] 扑克牌 (二分答案,巧解)

    Description 你有n种牌,第i种牌的数目为ci.另外有一种特殊的牌:joker,它的数目是m.你可以用每种牌各一张来组成一套牌,也可以用一张joker和除了某一种牌以外的其他牌各一张组成1套 ...

  6. 马士兵hadoop第三课:java开发hdfs(转)

    马士兵hadoop第一课:虚拟机搭建和安装hadoop及启动 马士兵hadoop第二课:hdfs集群集中管理和hadoop文件操作 马士兵hadoop第三课:java开发hdfs 马士兵hadoop第 ...

  7. Python入门--18--异常与try,except语句

    Python标准异常总结 AssertionError 断言语句(assert)失败 AttributeError 尝试访问未知的对象属性 EOFError 用户输入文件末尾标志EOF(Ctrl+d) ...

  8. Codeforces Gym101606 E.Education (2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017))

    E Education 这个题有点意思,就是找满足条件的最小价格里的最大值的人数,有点贪心的思想吧,一开始写错了,人群的那个不能排序,而且是最小价格里找能住下人最多的部门,让这个部门去住这个房间.在循 ...

  9. vue报错之Duplicate keys detected: '0'. This may cause an update error.

    昨天运行vue项目的时候,出现了[Vue warn]: Duplicate keys detected: '0'. This may cause an update error(错误,检测到重复的ke ...

  10. spring mvc表单的展现、输入处理、校验的实现

    之前已经实现了spring mvc的入门例子及如何处理带参数的请求Controller编写.本文主要记录: 1)重定向请求 2)处理路径中含有变量的请求 3)使用JSR-303进行校验 ① 首先,编写 ...