百度空间 | 百度首页 
 
查看文章
 
开源性能测试工具 - Apache ab 介绍(02)
2009-06-26 17:50

更多信息

ab不像LR那么强大,但是它足够轻便,如果只是在开发过程中想检查一下某个模块的响应情况,或者做一些场景比较简单的测试,ab还是一个不错的选择——至少不用花费很多时间去学习LR那些复杂的功能,就更别说那License的价格了。

下面是ab的详细参数解释,大家有兴趣的可以研究一下:

ab[ -Aauth-username:password] [ -cconcurrency] [ -Ccookie-name=value] [ -d] [ -ecsv-file] [ -ggnuplot-file] [ -h] [ -Hcustom-header] [ -i] [ -k] [ -nrequests] [ -pPOST-file] [ -Pproxy-auth-username:password] [ -q] [ -s] [ -S] [ -ttimelimit] [ -Tcontent-type] [ -vverbosity] [ -V] [ -w] [ -x<table>-attributes] [ -Xproxy[:port] ] [ -y<tr>-attributes] [ -z<td>-attributes] [http://]hostname[:port]/path

-Aauth-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).

(支持基本身份验证,用户名和密码用“:”隔开,并且以base64编码发送,不管是服务器需不需要。(例如401验证需要的))

-cconcurrency

Number of multiple requests to perform at a time. Default is one request at a time.

(同时发送多重请求,默认是一次)

-Ccookie-name=value

Add aCookie:line to the request. The argument is typically in the form of aname=valuepair. This field is repeatable.

(添加cookie:成行的请求,参数代表表单中的 name=value,字段可以重复)

-d

Do not display the "percentage served within XX [ms] table". (legacy support).

(不显示“发送的百分比在 xx 表格中”(依然支持))

-ecsv-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'.

(把请求的时间从1%到100%以毫秒的形式写入到一个以逗号隔开的CSV文件中,通常比'gnuplot'文件更有用;)

-ggnuplot-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.

(将所有估计的值输出到gnuplot或者是以tab间隔的TSV文件,这种文件很容易就导入到包里边,像Gnuplot、IDL、Mathematica、Igor或者even Excel,文件的第一行为标签。)

-h

Display usage information.

(显示使用信息)

-Hcustom-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 HEAD requests instead of GET.

(将GET以头部请求的方式替代)

-k

Enable the HTTP Keep Alive feature,i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.

(开启保持HTTP在线状态,用一个HTTP session执行多个请求,默认是不在线;)

-nrequests

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.
(大量的请求都会以session基准,默认的只是单纯的执行请求,不会有基准的结果。)

-pPOST-file

File containing data to POST.

(将文件的内容作为POST的数据)

-Pproxy-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).

(为代理提供基本身份验证,用户名和密码都以“:”隔开,发送的时候以base64编码,不管代理需不需要。例如:发送一个407验证)

-q

When processing more than 150 requests,about puts a progress count on stder revery 10% or 100 requests or so. The-q flag will suppress these messages.

(当处理超过150个请求,会将请求输出为百分之10到100%,-q参数会压缩这些信息)

-s

When compiled in (ab -h will show you) use the SSL protected https rather than the http protocol. This feature is experimental and very rudimentary. You probably do not want to use it.

(当编制SSL请求、HTTP请求,倒不如用http协议,实验表明是非常基础的,你可能不会像用它。)

-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).

(不显示中间和和标准偏差的值,也不显示警告和错误信息,当平均的和中间值比一个或者两个标准偏差值差距太大,默认显示最小、平均、最大值。)

-ttimelimit


类别:默认分类 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu