`
ijavagos
  • 浏览: 1189583 次
  • 性别: Icon_minigender_2
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Web 压力测试工具 --Apache AB

 
阅读更多

AB(ApacheBench)Apache自带的超文本传输协议(HTTP)性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能, 主要是显示Apache每秒可以处理多少个请求。

该工具是Apache自带的工具。 安装了Apache Http Server 就有了ap 程序。 Apache Server 可以从Apache 官网直接下载:

http://httpd.apache.org/download.cgi#apache22

安装完后,在apacheBin目录下有ab.exe 程序。 这个就是我们的AB工具。

AB 工具的使用方法:

C: >cd C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin

C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin>ab

ab: wrong number of arguments

Usage: ab [options] [http://]hostname[:port]/path

Options are:

-n requests Number of requests to perform

-c concurrency Number of multiple requests to make

-t timelimit Seconds to max. wait for responses

-b windowsize Size of TCP send/receive buffer, in bytes

-p postfile File containing data to POST. Remember also to set -T

-u putfile File containing data to PUT. Remember also to set -T

-T content-type Content-type header for POSTing, eg.

'application/x-www-form-urlencoded'

Default is 'text/plain'

-v verbosity How much troubleshooting info to print

-w Print out results in HTML tables

-i Use HEAD instead of GET

-x attributes String to insert as table attributes

-y attributes String to insert as tr attributes

-z attributes String to insert as td or th attributes

-C attribute Add cookie, eg. 'Apache=1234. (repeatable)

-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'

Inserted after all normal header lines. (repeatable)

-A attribute Add Basic WWW Authentication, the attributes

are a colon separated username and password.

-P attribute Add Basic Proxy Authentication, the attributes

are a colon separated username and password.

-X proxy:port Proxyserver and port number to use

-V Print version number and exit

-k Use HTTP KeepAlive feature

-d Do not show percentiles served table.

-S Do not show confidence estimators and warnings.

-g filename Output collected data to gnuplot format file.

-e filename Output CSV file with percentages served

-r Don't exit on socket receive errors.

-h Display usage information (this message)

C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin>

示例:

C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin>ab -n 1000 -c 50 http://blog.csdn.net/tianlesoftware/archive/2010/05/25/5622268.aspx

-- 注意, 这里要写一个具体的页面

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

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

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

Benchmarking blog.csdn.net (be patient)

Completed 100 requests

Completed 200 requests

Completed 300 requests

Completed 400 requests

Completed 500 requests

Completed 600 requests

Completed 700 requests

Completed 800 requests

Completed 900 requests

Completed 1000 requests

Finished 1000 requests

Server Software: nginx/0.7.65

Server Hostname: blog.csdn.net

Server Port: 80

Document Path: /tianlesoftware/archive/2010/05/25/5622268.aspx --请求资源

Document Length: 169 bytes --文档返回的长度,不包括相应头

Concurrency Level: 50 --并发个数

Time taken for tests: 118.549 seconds --请求消耗总时间

Complete requests: 1000 --总请求数

Failed requests: 1

(Connect: 1, Receive: 0, Length: 0, Exceptions: 0)

Write errors: 0

Non-2xx responses: 1000

Total transferred: 334000 bytes

HTML transferred: 169000 bytes

Requests per second: 8.44 [#/sec] (mean) --平均每秒请求数

Time per request: 5927.439 [ms] (mean) --平均每个请求时间

Time per request: 118.549 [ms] (mean, across all concurrent requests)

--平均每个请求时间除以并发数, 这里是5927.439/50

Transfer rate: 2.75 [Kbytes/sec] received -- 时间传输速率

Connection Times (ms)

min mean[+/-sd] median max

Connect: 47 97 72.8 63 742

Processing: 57 5720 4597.9 4666 25381

Waiting: 54 2711 3312.5 2128 25176

Total: 112 5817 4595.1 4754 25435

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

50% 4754 --

66% 5491

75% 6005

80% 6274

90% 7366

95% 8697

98% 25232

99% 25415

100% 25435 (longest request)

C:/Program Files (x86)/Apache Software Foundation/Apache2.2/bin>

含义: 同时处理50个并发请求并运行 1000 :

/tianlesoftware/archive/2010/05/25/5622268.aspx

结果: 在并发50个请求的情况下,完成1000次的访问请求,共花了118.549秒,这个程序每秒可处理8.44个请求。

小结:

测试AB的时候,随便在自己的Blog上找了一个网页, 结果测完之后,Blog 就打不开了。 杯具啊。 过了十几分钟才恢复。 下次测试不拿自己的blog 玩了。 - -

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

Blog http://blog.csdn.net/tianlesoftware

网上资源: http://tianlesoftware.download.csdn.net

相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx

DBA1 群:62697716(); DBA2 群:62697977()

DBA3 群:62697850 DBA 超级群:63306533;

聊天 群:40132017

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

分享到:
评论

相关推荐

    apache benchmark ab.exe

    一般用户压力测试用。参数如下 .\ab.exe --help Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make at a time -t timelimit Seconds to max. to ...

    压力测试工具apache-ab讲解

    现在有些压力测试工具都是收费的。在开源的apache中自带个ab工具。在C:Apache2. …  近在做webservices,得到的数据是从德国那边的服务器。要将这些数据整合到现在网站中去。不知道性能如何。做个压力测试。现在...

    压力测试工具ab(Apache Bench)的使用

     ab其实是apache服务器自带的压力测试工具。但它除了可以对apache服务器进行压力测试之外,也可以对其它类似web server进行压力测试,比如nginx、tomcat、IIS等等。  linux系统下安装过apache httpd服务后可以...

    AB压力测试实例.pdf

    Apache附带的压⼒测试工具apache bench--简称ab,⾮常容易使⽤, 并且完全可以模拟各种条件对Web服务器发起测试请求。ab可以直接在Web服务器本地发起测试请求,这对于了解服务器的处理性能至关重要,因为它不包括...

    Web性能压力测试工具之ApacheBench详解

    Apache中有个自带的,名为ab的程序,可以对Apache或其它类型的服务器进行网站访问压力测试。  ApacheBench命令原理:  ab命令会创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问。它的测试...

    如何通过Apache Bench实现web压力测试

     ApacheBench 是 Apache 服务器自带的一个web压力测试工具,简称ab。ab又是一个命令行工具,对发起负载的本机要求很低,根据ab命令可以创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问,因此可以...

    Web服务器压力测试

    ab是Apache超文本传输协议(HTTP)的性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能, 主要是显示你安装的Apache每秒可以处理多少个请求。 本文通过实例,来阐述ab的使用和意义。

    一款不错的网站压力测试工具webbench

    webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便。 1、适用系统:Linux 2、编译安装: tar zxvf webbench-1.5.tar.gz cd webbench-1.5 make...

    Linux网站压力测试工具webbench

    目前有很多免费的web压力测试工具可以帮助我们完成测试, 例如: 十个免费的Web压力测试工具http://coolshell.cn/articles/2589.html,但在真实项目中使用Apache ab和Webbench来完成压力测试。Apache的优点:Apache的...

    Apache Bench

    ApacheBench 是 Apache 服务器自带的一个web压力测试工具,简称ab。ab又是一个命令行工具,对发起负载的本机要求很低,根据ab命令可以创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问,因此可以...

    Gatling实用技术 ----高性能轻量级压力测试工具

     专用web测试。  像LR那样录制脚本,不用从零开始。  脚本使用scala语言,易懂,易修改,控制灵活。  基于JVM,随拷随用。(对比LoadRunner的客户端安装以及JMeter需要XWindow组件,这个方便很多),操作...

    ab压力测试的安装、使用、破2万并发测试

    ab命令是Apache自带的压力测试工具。 ab命令非常的实用,它不仅可以对Apache服务器进行压力测试,也可以对其它的WEB服务器进行压力测试。如:Nginx、Tomcat、IIS等 ab的原理 ab命令的原理 ab命令会创建多个并发访问...

    Apache Web应用详解及优化全攻略

    一、apache优化之保持连接、网页传输压缩、页面缓存时间; 二、apache优化隐藏版本...四、apache的ab压力测试; 五、apache 日志分析工具; 六、apache访问控制; 七、apache优化之日志分割; 八、apache实现虚拟主机;

    ab网站压力测试命令

    诸如微软的WAST,惠普的LoadRunner以及等等其他的,但这些软件学习起来还是需要花费些时间,在选择上实在头痛,后来在郭欣的那本《构建高性能WEB站点》上看到了他介绍的这款Apache自带的压力测试工具ab,十分喜爱,...

    window10本地电脑使用Apache Bench简称(ab)工具进行web端网站测试

    下载我们需要的测试工具(ab)到你的电脑中apache bench工具下载地址 将下好的压缩包放在你的任意磁盘中,并解压出压缩包里的,我是解压缩到了D盘中 使用window10命令行工具打开ab测试工具 第一步: 第二步 :...

    apache性能测试工具

    它的测试目标是基于URL的,因此,它既可以用来测试apache的负载压力,也可以测试nginx、lighthttp、tomcat、IIS等其它Web服务器的压力。  ab命令对发出负载的计算机要求很低,它既不会占用很高CPU,也不会占用很多...

    Linux下Web网站压力测试工具Webbench使用教程

    webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便。

    CentOS环境下单独安装apachebench的方法

    为了做压力测试可观察效果,就选择了ApacheBench来作为压力测试工具。其实就是大家常说的ab。 但是这个工具是安装apache web server的时候自带的,现在我服务器上都是跑nginx。也不想为了用这个工具就再装个apache。...

    boom-master.zip

    Boom 是一个把负载加到web应用上的一款小工具,它类似于ab工具,但是在各个平台上都很好安装,Boom原来是 Tarek Ziade 使用phython实现的,是一个用Go语言实现的压力测试工具,就是和Apache Bench类似的工具。

Global site tag (gtag.js) - Google Analytics