1.安装AB工具:

yum install httpd-tools

2.测试:

ab -n  -c  http://localhost.com/

其中-n表示请求数,-c表示并发数

3.测试结果

[root@vijay01 ~]# ab -c  -n  http://192.168.2.11/ab.html
This is ApacheBench, Version 2.3 <$Revision: $>
Copyright Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.2.11 (be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests Server Software: nginx/1.0.
Server Hostname: 192.168.2.11
Server Port: Document Path: /ab.html
Document Length: bytes Concurrency Level:
Time taken for tests: 0.105 seconds
Complete requests:
Failed requests:
Write errors:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 9515.20 [#/sec] (mean)
Time per request: 1.051 [ms] (mean)
Time per request: 0.105 [ms] (mean, across all concurrent requests)
Transfer rate: 36332.46 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0.2
Processing: 0.5
Waiting: 0.4
Total: 0.5 Percentage of the requests served within a certain time (ms)
%
%
%
%
%
%
%
%
% (longest request)

--------------------------------------------------------------------------------------------------------------------

Server Software:        nginx/1.0.
Server Hostname: 192.168.2.11
Server Port:
  • 这段展示的是web服务器的信息,可以看到服务器采用的是nginx,域名是wan.bigertech.com,端口是80
Document Path:          /ab.html
Document Length: bytes
  • 这段是关于请求的文档的相关信息,所在位置“/”,文档的大小为338436 bytes(此为http响应的正文长度)

------------------------------------------------------------------------------------------------------------------

Concurrency Level:
Time taken for tests: 0.105 seconds
Complete requests:
Failed requests:
Write errors:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 9515.20 [#/sec] (mean)
Time per request: 1.051 [ms] (mean)
Time per request: 0.105 [ms] (mean, across all concurrent requests)
Transfer rate: 36332.46 [Kbytes/sec] received
  • 这段展示了压力测试的几个重要指标

  Concurrency Level: 100           --并发请求数
  Time taken for tests: 50.872 seconds   --整个测试持续的时间
  Complete requests: 1000          --完成的请求数
  Failed requests: 0                 --失败的请求数

  Total transferred: 13701482 bytes      --整个场景中的网络传输量
  HTML transferred: 13197000 bytes     --整个场景中的HTML内容传输量

Requests per second: 19.66 [#/sec] (mean)     --吞吐率,大家最关心的指标之一,相当于 LR 中的每秒事务数,后面括号中的 mean 表示这是一个平均值
Time per request: 5087.180 [ms] (mean)          --用户平均请求等待时间,大家最关心的指标之二,相当于 LR 中的平均事务响应时间,后面括号中的 mean 表示这是一个平均值
Time per request: 50.872 [ms] (mean, across all concurrent requests)    --服务器平均请求处理时间,大家最关心的指标之三

Transfer rate: 263.02 [Kbytes/sec] received             --平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题

-----------------------------------------------------------------------------------------------------

Connection Times (ms) min  mean[+/-sd] median   max
Connect: 0.2
Processing:      0.5
Waiting:      0.4
Total:      0.5
  • 这段表示网络上消耗的时间的分解

------------------------------------------------------------------------------------------------------

Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 2
95% 2
98% 2
99% 3
100% 5 (longest request)

  

  • 这段是每个请求处理时间的分布情况,50%的处理时间在4930ms内,66%的处理时间在5008ms内...,重要的是看90%的处理时间。

 

 

AB压力测试工具的更多相关文章

  1. 4分钟apache自带ab压力测试工具使用: 2015.10.4

    2015.10.44分钟apache自带ab压力测试工具使用:win8.1 wampserver2.5 -Apache-2.4.9-Mysql-5.6.17-php5.5.12-64b 可以参考一下部 ...

  2. win8.1上wamp环境中利用apache自带ab压力测试工具使用超简单讲解

    2015.10.4apache自带ab压力测试工具使用:本地环境:win8.1 wampserver2.5 -Apache-2.4.9-Mysql-5.6.17-php5.5.12-64b 可以参考一 ...

  3. ab压力测试工具-批量压测脚本

    ab(Apache benchmark)是一款常用的压力测试工具.简单易用,ab的命令行一次只能支持一次测试.如果想要批量执行不同的测试方式,并自动对指标进行分析,那么单靠手工一条一条命令运行ab,估 ...

  4. 如何使用apache自带的ab压力测试工具

    ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab 1 我们可以模拟100个并发用户,对一个页面发送1000个请求 ./ab -n1000 -c1 ...

  5. 【Linux】ApacheBench(ab)压力测试工具

    AB的简介 ab是apachebench命令的缩写. ab是apache自带的压力测试工具.ab非常实用,它不仅可以对apache服务器进行网站访问压力测试,也可以对或其它类型的服务器进行压力测试.比 ...

  6. Windows如何使用Apache的ab工具进行网站性能测试(Apache服务器自带了ab压力测试工具,可以用来测试网站性能,使用简单方便)

    打开Apache服务器的安装路径,在bin目录中有一个ab.exe的可执行程序,就是我们要介绍的压力测试工具. 在Windows系统的命令行下,进入ab.exe程序所在目录,执行ab.exe程序.注意 ...

  7. linux ab压力测试工具及ab命令详解

    原文链接:https://blog.csdn.net/qq_27517377/article/details/78794409 yum -y install httpd-tools ab -v 查看a ...

  8. ab压力测试工具的简单使用

    ab是一种用于测试Apache超文本传输协议(HTTP)服务器的工具.apache自带ab工具,可以测试 apache.IIs.tomcat.nginx等服务器 但是ab没有Jmeter.Loadru ...

  9. ab压力测试工具的使用

    一.下载稳定版2.2.31 http://httpd.apache.org/ 二.2.2.*和2.4.*区别? httpd-2.2.x(prefork)    httpd-2.4.x(event) 编 ...

  10. apache ab 压力测试工具

    Apache的ab命令模拟多线程并发请求,测试服务器负载压力,也可以测试nginx.lighthttp.IIS等其它Web服务器的压力.Apache附带的ab工具(使用的PHP环境是WAMP集成环境, ...

随机推荐

  1. JS-easyui 扩展easyui.datagrid,添加数据loading遮罩效果代码

    (function (){ $.extend($.fn.datagrid.methods, { //显示遮罩 loading: function(jq){ return jq.each(functio ...

  2. 关于Cocos2d-x手机上运行游戏的时候屏幕横屏改竖屏的解决方案

    cocos2d-x打包的时候默认是横屏,如果要改成竖屏,步骤如下: 1.打开项目 2.打开proj.android 3.编辑AndroidManifest.xml 4. 找到这一句android:sc ...

  3. linux常用命令中篇

    1.打印当月的日期

  4. 适配器模式(Adapter Pattern)----------结构型模式

    对象适配器模式的缺点是:与类适配器模式相比,要在适配器中置换适配着类的某些方法比较麻烦.如果一定要置换掉适配者类的一个或多个方法,可以先做一个适配者类的子类,在子类中将适配者类的方法置换掉,然后再把适 ...

  5. 关于android 调用网页隐藏地址栏

    首先创建项目,在main.xml里 添加好WebView控件R.id为webview1. HelloWebView.java 代码 package liu.ming.com; import andro ...

  6. jQuery语法小结(超实用)

    1.关于页面元素的引用 通过jquery的$()引用元素包括通过id.class.元素名以及元素的层级关系及dom或者xpath条件等方法,且返回的对象为jquery对象(集合对象),不能直接调用do ...

  7. weblogic安装部署war包——windows

    ### weblogic安装部署war包——windows#### 下载weblogic安装包[csdn下载地址](https://download.csdn.net/download/luozhua ...

  8. opencv移植到ubuntu

    原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ OpenCV 2.2以后版本需要使用Cmake生成makefile文件,因此需要先安装cmake ...

  9. C# GetType和typeof的区别

    typeof: The typeof operator is used to obtain the System.Type object for a type. 运算符,获得某一类型的 System. ...

  10. opencascade读取iges并用vtk离散的一些问题

    近期抽时间在弄iges文件内容读取的工作.然后将其离散化在vtk中能够显示处理以及兴许的一些工作.主要目的是识别CAD文件导出的模型,然后进行离散处理.方便兴许的处理.离散工作比較简单.opencas ...