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

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

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

安装完后,在apache的Bin目录下有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表空间和数据文件的关系,否则拒绝申请

Web 压力测试工具 --Apache AB相关推荐

  1. 性能/压力测试工具Apache ab修改:按时间进行性能/压力测试

    需求: 在对Nginx module 采用Aapche ab进行性能和压力测试的过程中发现: 1. 对于不同的并发线程,相同的请求数,性能/压测所需要的时间变化比较大: 2. 对于高并发的情况下,千万 ...

  2. python的web压力测试工具-pylot安装使用

    pylot是python编写的一款web压力测试工具.使用比较简单.而且测试结果相对稳定. 这里不得不鄙视一下apache 的ab测试,那结果真是让人蛋疼,同样的url,测试结果飘忽不定,看得人心惊肉 ...

  3. ab测试工具 linux,超实用压力测试工具-ab工具

    写在前面 在学习ab工具之前,我们需了解几个关于压力测试的概念吞吐率(Requests per second) 概念:服务器并发处理能力的量化描述,单位是reqs/s,指的是某个并发用户数下单位时间内 ...

  4. [收藏]超实用压力测试工具-ab工具

    本文转载自:https://www.jianshu.com/p/43d04d8baaf7 写在前面 在学习ab工具之前,我们需了解几个关于压力测试的概念 吞吐率(Requests per second ...

  5. 压力测试工具-ab工具

    写在前面 在学习ab工具之前,我们需了解几个关于压力测试的概念 吞吐率(Requests per second) 概念:服务器并发处理能力的量化描述,单位是reqs/s,指的是某个并发用户数下单位时间 ...

  6. 压力测试ab安装 linux,Centos8下安装ab压力测试工具及ab命令详解

    释放双眼,带上耳机,听听看~! 1.ab的简介 ab是apachebench命令的缩写. ab是apache自带的压力测试工具.ab非常实用,它不仅可以对apache服务器进行网站访问压力测试,也可以 ...

  7. html5 并发测试工具,超实用压力测试工具-ab工具

    吞吐率(Requests per second) 概念:服务器并发处理能力的量化描述,单位是reqs/s,指的是某个并发用户数下单位时间内处理的请求数.某个并发用户数下单位时间内能处理的最大请求数,称 ...

  8. asp.net core系列 67 Web压力测试工具WCAT

    asp.net core系列 67 Web压力测试工具WCAT 原文:asp.net core系列 67 Web压力测试工具WCAT 一.介绍 最近搭建了一套CQRS框架,需要在投入开发前,进行必要的 ...

  9. linux下web压力测试工具ab使用及详解

    APACHE自带的测试工具AB(apache benchmark).在APACHE的bin目录下. 格式: ./ab [options] [http://]hostname[:port]/path 参 ...

最新文章

  1. Netbeans and Remote Host for C/C++ Developing
  2. python爬虫企业级技术点_Python爬虫必备技术点(一)
  3. Python SIP使用总结(WinLinux通用)
  4. 一文带你读懂单目视觉SLAM数据关联优化
  5. 【FPGA】Vivado 保姆级安装教程 | 从官网下载安装包开始到安装完毕 | 每步都有详细截图说明 | 支持无脑跟装
  6. react中使用video标签显示本地视频不生效问题
  7. 【中级计量经济学】Lecture 9 面板数据模型
  8. php redis 令牌桶算法
  9. Telink BDT 的使用方法
  10. 用计算机控制人造卫星和导弹发射,用计算机控制人造卫星和导弹的发射,按计算机应用的分类,它应属于什么...
  11. apache OpenNLP简要介绍
  12. Echarts使用感悟
  13. 共享充电步入“大三元”时代,三电一兽们吃得饱吗?
  14. vue2.0 日历日程表 ,可进行二次开发.
  15. 2020手机CPU性能天梯图
  16. Kotlin GreenDao
  17. 独木舟上的旅行(船问题贪心)
  18. 前端面试题(背题中)
  19. MyEclipse老是提示 resetting selection 长耗时的问题
  20. STM32 nokia 5110应用

热门文章

  1. 「机器人界的微软」创始人逝世,从iPhone到汽车都离不开他的创造
  2. 英伟达一大波硬件来袭:今日GTC发布专业GPU与DPU,为收购ARM将在英国建超算
  3. 华为「硬」生生把AI搞出暴力美学
  4. 专访梅耶·马斯克:硅谷钢铁侠是怎样被炼成的?
  5. 港中文提出全新点云上采样方法,破解自动驾驶感知难题
  6. 27年前被Nature拒稿,如今斩获诺贝尔奖!学术投稿模式再引热议:都有神奇的评审2...
  7. 第6章 I/O复用 select 和 poll 函数
  8. clouderamanager-server启动,log日志中说需要mysql驱动的解决办法
  9. 设置Eclipse编码方式
  10. 【推荐】R for Data Science 新书抢先看