ab – Apache HTTP server benchmarking tool,翻译为中文

1、英文原地址为:https://httpd.apache.org/docs/2.4/programs/ab.html,如图1

英文原地址为:https://httpd.apache.org/docs/2.4/programs/ab.html

2、选项翻译如下:

ab – Apache HTTP server benchmarking tool
ab – Apache HTTP服务器压力测试工具

Available Languages: en | fr | ko | tr
可用语言:en | fr | ko | tr

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是一个对Apache超文本传输协议(HTTP)服务器进行性能测试的工具。它旨在让您了解当前所安装的Apache的执行性能。主要显示了您所安装的Apache能够服务的每秒请求数量(即每秒可处理的请求数)。

Synopsis
概要

ab [ -A auth-username:password ] [ -b windowsize ] [ -B local-address ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -f protocol ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -l ] [ -m HTTP-method ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -r ] [ -s timeout ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -u PUT-file ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [ -Z ciphersuite ] [http[s]://]hostname[:port]/path
ab [ -A 认证用户名:密码 ] [ -b 窗口大小 ] [ -B 本地地址 ] [ -c 并发数 ] [ -C cookie名称=值 ] [ -d ] [ -e csv文件 ] [ -f 协议 ] [ -g gnuplot文件 ] [ -h ] [ -H 自定义头信息 ] [ -i ] [ -k ] [ -l ] [ -m HTTP方法 ] [ -n 请求数 ] [ -p POST文件 ] [ -P 代理认证用户名:密码 ] [ -q ] [ -r ] [ -s 超时 ] [ -S ] [ -t 时间限制 ] [ -T 内容类型 ] [ -u PUT文件 ] [ -v 详细] [ -V ] [ -w ] [ -x <表> -属性 ] [ -X 代理[:端口] ] [ -y <行> -属性 ] [ -z <列> -属性 ] [ -Z 密码套件 ] [http[s]://]主机名[:端口]/路径

Options
选项

-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).
-A 认证用户名:密码
向服务器提供BASIC身份验证凭据。用户名和密码由:分隔,并以base64编码形式发送。无论服务器是否需要(即,已发送了401认证所需),此字符串都会被发送。

-b windowsize
Size of TCP send/receive buffer, in bytes.
-b 窗口大小
TCP发送/接收缓冲区的大小,以字节为单位。

-B local-address
Address to bind to when making outgoing connections.
-B 本地地址
发出连接时要绑定的地址。

-c concurrency
Number of multiple requests to perform at a time. Default is one request at a time.
-c 并发数
一次执行的请求数。默认是一次一个请求。

-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.
-C cookie名称=值
在请求中添加Cookie:行。参数的形式通常是name=value对。该参数是可以重复的。

-d
Do not display the “percentage served within XX [ms] table”. (legacy support).
-d
不要显示“在XX [ms]表中提供的百分比”的消息。(为以前的版本提供支持)。

-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’.
-e csv文件
写一个以逗号分隔的(CSV)文件,其中包含每个百分比(从1%到100%),用于提供该百分比请求所花费的时间(以毫秒为单位)。这通常比’gnuplot’格式文件更有用; 因为其结果已经“合并”了。

-f protocol
Specify SSL/TLS protocol (SSL2, SSL3, TLS1, TLS1.1, TLS1.2, or ALL). TLS1.1 and TLS1.2 support available in 2.4.4 and later.
-f 协议
指定SSL/TLS协议(SSL2,SSL3,TLS1,TLS1.1,TLS1.2或ALL)。2.4.4及更高版本中提供了对于TLS1.1和TLS1.2的支持。

-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.
-g gnuplot文件
将所有测量值写入一个“gnuplot”或TSV(以Tab分隔的)文件。该文件可以轻松地导入到Gnuplot,IDL,Mathematica,Igor甚至Excel等软件包中。标题位于文件的第一行。

-h
Display usage information.
-h
显示使用信息。

-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”).
-H 自定义头信息
为请求附加额外的头信息。参数的形式通常是有效的头信息行,包含冒号分隔的字段和值的对(即“Accept-Encoding:zip / zop; 8bit”)。

-i
Do HEAD requests instead of GET.
-i
执行HEAD请求而不是GET。

-k
Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
-k
启用HTTP KeepAlive功能,即在一个HTTP会话内执行多个请求。默认是没有启用KeepAlive功能的。

-l
Do not report errors if the length of the responses is not constant. This can be useful for dynamic pages. Available in 2.4.7 and later.
-l
如果响应的长度不是常数,则不报告错误。对于动态页面这可能是有用的。2.4.7及更高版本中可用。

-m HTTP-method
Custom HTTP method for the requests. Available in 2.4.10 and later.
-m HTTP方法
在请求中可自定义HTTP方法。2.4.10及更高版本中可用。

-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.
-n 请求数
在基准测试会话内的执行请求数。默认是只执行一个单一的请求,通常其基准测试结果不具有代表性。

-p POST-file
File containing data to POST. Remember to also set -T.
-p POST文件
包含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).
-P 代理认证用户名:密码
向代理路由提供BASIC身份验证凭据。用户名和密码由:分隔,并以base64编码形式发送。无论代理是否需要(即,已发送了407代理认证所需),此字符串都会被发送。

-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.
-q
当处理的请求数超过150个的时候,ab每处理10%或100个请求时,就会在stderr输出进度计数。-q标记将会抑制这些消息。

-r
Don’t exit on socket receive errors.
-r
在套接字接收到错误时,不要退出。

-s timeout
Maximum number of seconds to wait before the socket times out. Default is 30 seconds. Available in 2.4.4 and later.
-s 超时
在套接字超时之前等待的最大秒数。默认值为30秒。2.4.4及更高版本中可用。

-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).
-S
不要显示中值和标准偏差值,当平均值和中值是标准偏差值的一倍或两倍以上时,不显示警告/错误信息。并默认显示为最小值/平均值/最大值。(为以前的版本提供支持)。

-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.
-t 时间限制
用于基准测试的最大秒数。其内部默认隐含-n 50000。它可以使对服务器的测试限制在一个固定的总时间内。默认情况下没有时间限制。

-T content-type
Content-type header to use for POST/PUT data, eg. application/x-www-form-urlencoded. Default is text/plain.
-T 内容类型
用于POST/PUT数据的Content-type头信息,例如:application/x-www-form-urlencoded。默认为text/plain。

-u PUT-file
File containing data to PUT. Remember to also set -T.
-u PUT文件
包含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.
-v 详细
设置显示信息的详细程度 – 4及以上打印头信息,3及以上打印响应代码(404,200等),2及以上打印警告和信息。

-V
Display version number and exit.
-V
显示版本号并退出。

-w
Print out results in HTML tables. Default table is two columns wide, with a white background.
-w
在HTML表格中打印出结果。默认是两列宽,带有白色背景的一张表。

-x <table>-attributes
String to use as attributes for <table>. Attributes are inserted <table here >.
-x <表> -属性
设置表的属性的字符串。此属性被插入<table 这里>。

-X proxy[:port]
Use a proxy server for the requests.
-X 代理[:端口]
对请求使用代理服务器。

-y <tr>-attributes
String to use as attributes for <tr>.
-y <行> -属性
设置行的属性的字符串。

-z <td>-attributes
String to use as attributes for <td>.
-z <列> -属性
设置列的属性的字符串。

-Z ciphersuite
Specify SSL/TLS cipher suite (See openssl ciphers)
-Z 密码套件
指定SSL/TLS密码套件(请参见openssl密码)

2、输出翻译如下:

Output
输出

The following list describes the values returned by ab:
以下列表描述了ab返回的值:

Server Software
The value, if any, returned in the server HTTP header of the first successful response. This includes all characters in the header from beginning to the point a character with decimal value of 32 (most notably: a space or CR/LF) is detected.
服务器软件
在第一个成功响应的服务器HTTP头中的返回值(如果有)。这包括头信息中从开始到点范围内所检测到的十进制值为32(最值得注意的是:空格或CR/LF)的所有字符。

Server Hostname
The DNS or IP address given on the command line
服务器主机名
在命令行中给出的DNS或IP地址

Server Port
The port to which ab is connecting. If no port is given on the command line, this will default to 80 for http and 443 for https.
服务器端口
ab连接的端口。如果在命令行中没有给出端口,那么HTTP将默认为80,而对于https则为443。

SSL/TLS Protocol
The protocol parameters negotiated between the client and server. This will only be printed if SSL is used.
SSL/TLS协议
客户端和服务器之间协商的协议参数。此输出将仅在SSL被使用时打印。

Document Path
The request URI parsed from the command line string.
文档(请求根)路径
从命令行字符串中所解析出的请求URI。

Document Length
This is the size in bytes of the first successfully returned document. If the document length changes during testing, the response is considered an error.
文档长度
这是第一个成功返回的文档的大小(以字节为单位)。如果文档长度在测试期间发生变化,则该响应被认为是错误的。

Concurrency Level
The number of concurrent clients used during the test
并发级别(用户数)
在测试期间使用的并发客户端的数量

Time taken for tests
This is the time taken from the moment the first socket connection is created to the moment the last response is received
测试时间
这是从创建第一个套接字连接的时刻到接收到最后一个响应的时刻之间的时间长度

Complete requests
The number of successful responses received
完成请求数
收到的成功响应的数量

Failed requests
The number of requests that were considered a failure. If the number is greater than zero, another line will be printed showing the number of requests that failed due to connecting, reading, incorrect content length, or exceptions.
失败请求数
被认为是失败的请求数。如果数字大于零,将打印另外一行,用于显示由于连接服务器,读取,内容长度不正确或异常而导致的失败请求数。

Write errors
The number of errors that failed during write (broken pipe).
写入错误数
写入时失败的错误数量(断开管道)。

Non-2xx responses
The number of responses that were not in the 200 series of response codes. If all responses were 200, this field is not printed.
非2xx响应
不在200系列响应状态码中的响应数量。如果所有响应都是200,则不打印此字段。

Keep-Alive requests
The number of connections that resulted in Keep-Alive requests
Keep-Alive请求
导致Keep-Alive请求的连接数

Total body sent
If configured to send data as part of the test, this is the total number of bytes sent during the tests. This field is omitted if the test did not include a body to send.
请求体总字节数
如果请求体在测试时被配置为发送数据的一部分,此输出是测试期间发送的总字节数。如果测试数据没有包含请求体,则该字段将被省略。

Total transferred
The total number of bytes received from the server. This number is essentially the number of bytes sent over the wire.
响应数据总字节数
从服务器所接收到的总字节数。这个数字本质上是网络传输的字节数。

HTML transferred
The total number of document bytes received from the server. This number excludes bytes received in HTTP headers
响应体总字节数
从服务器接收的文件字节总数。此数字不包括HTTP头中接收的字节数

Requests per second
This is the number of requests per second. This value is the result of dividing the number of requests by the total time taken
每秒请求数
这是每秒请求的数量。该值是将请求数除以总时间的结果(Complete requests/Time taken for tests)

Time per request
The average time spent per request. The first value is calculated with the formula concurrency * timetaken * 1000 / done while the second value is calculated with the formula timetaken * 1000 / done
用户平均请求等待时间
每个请求花费的平均时间。通过公式:测试花费时间 * 1000(Time taken for tests * 1000) / (并发用户数 * 完成请求数)( Concurrency Level * Complete requests) 计算得出

Transfer rate
The rate of transfer as calculated by the formula totalread / 1024 / timetaken
传输率
传输速率通过公式:响应数据总字节数 / 1024 / 测试花费时间(Total transferred / 1024 / Time taken for tests) 计算得出

永夜

View Comments