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.
-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).
支持对服务器的基本验证。用':'把用户名和密码分隔,并通过base64加密后发送。
-b windowsize
Size of TCP send/receive buffer, in bytes.
TCP发送/接收的缓存大小,以字节为单位
-c concurrency
Number of multiple requests to perform at a time. Default is one request at a time.
一次进行的请求数,默认是1
-C cookie-name =value
Add a Cookie: line to the request. The argument is typically in the form of a name =value pair. This field is repeatable.
添加一个cookie,格式:name=value。 这个字段是重复的。
-d
Do not display the "percentage served within XX [ms] table". (legacy support).
不显示表格"percentage served within XX [ms] table", 支持旧版版本。
-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'.
-f protocol
Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL).
指定SSL/TLS协议(SSL2, SSL3, TLS1, 或 ALL)
-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 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" ).
-k
Enable the HTTP KeepAlive feature, i.e. , perform multiple requests within one HTTP session. Default is no KeepAlive.
启用HTTP KeepAlive功能,例如,一个HTTP session执行多个请求。 默认是 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.
基准测验会话时执行的请求数。 默认值是1,同时导致了没有任何代表含义的测试结果。
-p POST-file
File containing data to POST. Remember to also set -T.
POST包含数据的文件。同时需要设置 -T
-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, ab outputs a progress count on stderr every 10% or 100 requests or so. The -q flag will suppress these messages.
-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.
-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 50000 internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit.
基本测试花费的最大的秒数。 一般为-n 5000。 使用这个命令来测试服务器。
-T content-type
Content-type header to use for POST/PUT data, eg. application/x-www-form-urlencoded . Default: text/plain .
-u PUT-file
File containing data to PUT. Remember to also set -T .
要PUT的文件。 同时需要设置-T
-v verbosity
Set verbosity level - 4 and above prints information on headers, 3 and above prints response codes (404, 200, etc.), 2 and above prints warnings and info.