ApacheBench(ab)使用简介
来源:互联网 发布:冲击实验数据 编辑:程序博客网 时间:2024/05/09 14:09
ApacheBench 主要是用来测试阿帕奇服务器执行效率用的。安装好 apache 服务器套件后,进入 bin 目录,就可以找到该可执行文件 ab.exe 。
ApacheBench 可以针对某一特定 URL 模拟出连续的联机请求,同时还可以仿真出同时间点个数相同的联机请求,因而利用 ApacheBench 可帮助我们在网站开发期间仿真实际上线可能的情况,利用仿真出来的数据做为调整服务器设定或程序的依据。
ab 用法如下
Usage: ab [options] [http[s]://]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
-p postfile File containing data to POST
-T content-type Content-type header for POSTing
-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
-s Use httpS instead of HTTP (SSL)
-h Display usage information (this message)
基本用法 :
ab -n 全部请求数 -c 并发数 测试 url
例 :ab -n 1000 -c 50 http://www.abc.com/a.php
得到结果类似于 ( 后面颜色字为中文翻译 ):
Server Software: Apache/2.0.55
Server Hostname: localhost
Server Port: 80
Document Path: /1.php
Document Length: 82522 bytes # 请求文档大小
Concurrency Level: 50 # 并发数
Time taken for tests: 92.76140 seconds # 全部请求完成耗时
Complete requests: 10000 # 全部请求数
Failed requests: 1974 # 失败的请求
(Connect: 0, Length: 1974, Exceptions: 0)
Write errors: 0
Total transferred: 827019400 bytes # 总传输大小
HTML transferred: 825219400 bytes
Requests per second: 108.61 [#/sec] (mean) # 每秒请求数 ( 平均 )
Time per request: 460.381 [ms] (mean) # 每次并发请求时间 ( 所有并发 )
Time per request: 9.208 [ms] (mean, across all concurrent requests) # 每一请求时间 ( 并发平均 )
Transfer rate: 8771.39 [Kbytes/sec] received # 传输速率
Connection Times (ms) # 连接时间
min mean[+/-sd] median max
Connect(# 连接 ): 0 0 2.1 0 46
Processing(# 处理 ): 31 458 94.7 438 1078
Waiting(# 等待 ): 15 437 87.5 422 938
Total: 31 458 94.7 438 1078
其它参数 :
-n requests 全部请求数
-c concurrency 并发数
-t timelimit 最传等待回应时间
-p postfile POST 数据文件
-T content-type POST Content-type
-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 加入 cookie, eg. 'Apache=1234. (repeatable)
-H attribute 加入 http 头 , eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute http 验证 , 分隔传递用户名及密码
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port 代理服务器
-V 查看 ab 版本
-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
-h Display usage information (this message)
- ApacheBench(ab)使用简介
- ApacheBench(ab)使用简介
- ApacheBench(ab)使用简介
- ApacheBench(ab)使用简介
- ApacheBench(ab)详解
- ApacheBench(ab)测试工具
- ab命令(ApacheBench)
- ApacheBench(ab)安装篇
- ApacheBench(ab)压力测试使用和结果说明
- ApacheBench简介
- ApacheBench(ab)压力测试工具
- 使用apacheBench对网站进行压力测试(ab压力测试)
- PHP使用Apache中的ab(ApacheBench)测试网站的并发量
- 使用ApacheBench(ab)对URL进行压力测试(HTTP直压)
- Apache-ApacheBench(ab)网站压力测试
- ApacheBench(AB) 网页压力测试
- 轻量级压力测试Apache-ApacheBench(ab)
- ApacheBench(ab)测试工具小结
- 5月5日问题集
- js正则替换多个字符,多个参数调用只有一个参数的函数
- String.Format()返回字符串中有{}的用法
- CSDN中如何快速获得积分啊 小弟想下载资源啊 愁死了
- 解决 Redhat 出现”This system is not registered with RHN”更新
- ApacheBench(ab)使用简介
- Android 横竖屏切换
- Android Display System --- Surface Flinger
- Android调试.so库常用工具
- C#中利用正则表达式实现字符串搜索
- tar -C 解压到特定目录
- RCFile — 用于 Facebook 数据仓库的高效存储结构
- 拿手机干什么
- 基于memcached的SNA实现