ab
ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving。
语法:
ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [http://]hostname[:port]/path
-A auth-username:password- Supply BASIC Authentication credentials to the server. The username and password are separated by a single
:and sent on the wire base64 encoded. The string is sent regardless of whether the server needs it (i.e., has sent an 401 authentication needed). -c concurrency- Number of multiple requests to perform at a time. Default is one request at a time.
-C cookie-name=value- Add a
Cookie:line to the request. The argument is typically in the form of aname=valuepair. This field is repeatable. -d- Do not display the "percentage served within XX [ms] table". (legacy support).
-e csv-file- Write a Comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests. This is usually more useful than the 'gnuplot' file; as the results are already 'binned'.
-g gnuplot-file- Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.
-h- Display usage information.
-H custom-header- Append extra headers to the request. The argument is typically in the form of a valid header line, containing a colon-separated field-value pair (i.e.,
"Accept-Encoding: zip/zop;8bit"). -i- Do
HEADrequests instead ofGET. -k- Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
-n requests- Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.
-p POST-file- File containing data to POST.
-P proxy-auth-username:password- Supply BASIC Authentication credentials to a proxy en-route. The username and password are separated by a single
:and sent on the wire base64 encoded. The string is sent regardless of whether the proxy needs it (i.e., has sent an 407 proxy authentication needed). -q- When processing more than 150 requests,
aboutputs a progress count onstderrevery 10% or 100 requests or so. The-qflag will suppress these messages. -s- When compiled in (
ab -hwill show you) use the SSL protectedhttpsrather than thehttpprotocol. This feature is experimental and very rudimentary. You probably do not want to use it. -S- Do not display the median and standard deviation values, nor display the warning/error messages when the average and median are more than one or two times the standard deviation apart. And default to the min/avg/max values. (legacy support).
-t timelimit- Maximum number of seconds to spend for benchmarking. This implies a
-n 50000internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit. -T content-type- Content-type header to use for POST data.
-v verbosity- Set verbosity level -
4and above prints information on headers,3and above prints response codes (404, 200, etc.),2and above prints warnings and info. -V- Display version number and exit.
-w- Print out results in HTML tables. Default table is two columns wide, with a white background.
-x <table>-attributes- String to use as attributes for
<table>. Attributes are inserted<table here >. -X proxy[:port]- Use a proxy server for the requests.
-y <tr>-attributes- String to use as attributes for
<tr>. -z <td>-attributes- String to use as attributes for
<td>. - 鉴于市面上大多数翻译都或多或少的失去原有之意,所以本文是直接从apache官方文档上拷贝过来,没有做翻译,没有做任何的改动。
ab的更多相关文章
- 使用ab对nginx进行压力测试
nginx以高并发,省内存著称. 相信大多数安装nginx的同学都想知道自己的nginx性能如何. 我想跟大家分享下我使用ab工具的压力测试方法和结果, ab是针对apache的性能测试工具,可以只安 ...
- apache的AB测试
A/B测试A/B测试是一种新兴的网页优化方法,可以用于增加转化率注册率等网页指标..A/B测试的目的在于通过科学的实验设计.采样样本代表性.流量分割与小流量测试等方式来获得具有代表性的实验结论,并确信 ...
- apache自带ab压测
./ab -k -n100000 -c100 http://localhost/index.php -k表示保持连接keep-alive -n表示请求数 -c表示并发数 (总结)Web性能压力测试工具 ...
- 压力测试相关之ab命令
1. 短时压力测试工具 ab 命令(apache的工具) 关键指标: Requests per second: 98.52 [#/sec] (mean) ###平均每秒的请求数 Tim ...
- 【转载】AB测试结果分析
AB测试,200个请求,20个并发.这样的测试强度,CPU占了70-80%,w3p占用了70多M内存,本想多测几次,看看它的内存会不会涨上去,没 有测试机器没办法,开发机要干活.我估计CPU就有问题了 ...
- 使用Apache Server 的ab进行web请求压力测试
参考:http://www.cnblogs.com/spring3mvc/archive/2010/11/23/2414741.html 自己写代码经常是顺着逻辑写下去,写完后run一下,ok就玩完事 ...
- apache ab测试命令详解
这篇文章主要介绍了apache性能测试工具ab使用详解,需要的朋友可以参考下 网站性能压力测试是服务器网站性能调优过程中必不可缺少的一环.只有让服务器处在高压情况下,才能真正体现出软件.硬件等各种 ...
- 使用ab进行压力测试详解
ab是apache自带的压力测试工具,非常好用.转载几篇对ab工具的详细使用的博文.猛击下面的链接地址 http://www.365mini.com/page/apache-benchmark.htm ...
- centos ab命令安装
yum install apr-util -ymkdir abcd abyum -y install yum-utils -yyumdownloader httpd yum localinstall ...
随机推荐
- [C#版本]有趣啊!各种编程语言实现 2 + 2 = 5
首页新闻里面那个 [新闻头条]有趣啊!各种编程语言实现 2 + 2 = 5 其他的就不评论的,但是其中C#版的 真是逗比啊...评论中各种吐槽有木有... static void Main (stri ...
- CSS3 滤镜
了解摄影活着美图秀秀之类美图软件的同学对滤镜肯定不陌生,CSS3对各种滤镜效果有了支持,可以做出很多好玩儿效果,走马观花了解一下 语法 filter: function(param); 很很多CSS3 ...
- .NET基础 一步步 一幕幕[循环、逻辑语句块]
循环.逻辑语句块 好久不写博客了,断更了好几天了,从上周五到今天,从北京到上海,跨越了1213.0公里,从一个熟悉的城市到陌生的城市,还好本人适应力比较好,还有感谢小伙伴的接风咯,一切都不是事,好 ...
- 如何通过源生js获取一个元素的具体样式值 /* getCss:获取指定元素的具体样式的属性值 curElement:[dom对象] attr:[string] */
昨天的博客些的真的是惨不忍睹啊!!!但是我的人生宗旨就是将不要脸的精神进行到底,所以,今天我又来了.哈哈哈哈哈! 方法一:元素.style.属性名:(这个有局限性--只能获取行内样式的值,对于样式表或 ...
- MUI开发APP,scroll组件,运用到区域滚动
最近在开发APP的过程中,遇到一个问题,就是内容有一个固定的头部和底部. 头部就是我们常用的header了,底部的话,就放置一个button,用来提交页面数据或者进入下一个页面等,效果 ...
- Python基础(三)
本章内容: 深浅拷贝 函数(全局与局部变量) 内置函数 文件处理 三元运算 lambda 表达式 递归(斐波那契数列) 冒泡排序 深浅拷贝 一.数字和字符串 对于 数字 和 字符串 而言,赋值.浅拷贝 ...
- VS中C++ 项目重命名
应该都有过这样的经历,在Visual studio中创建解决方案,添加几个项目进去,然后开始愉快的敲代码....写代码正欢的时候,却总是感觉那里有些不舒服,一细看,这项目名称取的真心挫,修改个吧.直接 ...
- js实现蛇形矩阵
参加腾讯前端实习生笔试,真的是被虐了千百遍,除了一条js程序题,其他半点前端都没有,都是考算法,计算机原理,数据结构.下面贴上腾讯笔试最后三大条中的一条,实现一个蛇形矩阵的输出.蛇形矩阵的什么样这里我 ...
- 【MVVM Light】Messager的使用
一.前言 在MVVM编程的模式中,有时候我们会遇到一个很尴尬的情况: 若干个xaml.cs都复用一个ViewModel,当ViewModel想传递一个特定的消息给某一个xaml.cs的时候 ...
- [Q&A] C1DataGrid 奇葩的 BeginNewRow() 方法
一.前言 用户千千万,自然需求就千奇百怪都有,某天有人提了这样一个需求: 某个 C1DataGrid 在 ScrollViewer 的底部(使纵向滚动条显示出来),然后当该 C1DataGrid 增加 ...