Apache Benchmark Download
AB's full name is Apachebench, a gadget that comes with Apache and is designed for HTTP Server benchmark testing, which can simultaneously simulate multiple concurrent requests. Some time ago see the company's developers are also using it for some testing, it looks good, very simple and easy to use, so take a moment to look at it today.
With a simple example and a note below, it is believed that it is easier to understand the use of this tool.
A simple example
/* At the beginning of this example, I executed such a command ab-n 10-c http://www.baidu.com/ . This command means to start AB, send 10 requests to http://www.baidu.com/(-n 10), and send 10 requests (-C 10) at a time--that is, all at once. followed by the test report of the AB output, the red part is the comment I added. */
d:\\apache\bin>ab-n 10-c http://www.baidu.com/
This is apachebench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus technology LTD, http://www.zeustech.net/
Licensed to the Apache software Foundation, http://www.apache.org/
Benchmarking www.wayne.com (Be patient) ... done
Server software:gws/2.1
Server Hostname:www.baidu.com
Server port:80
Document Path:/
Document length:230 bytes
Concurrency level:10
/* Duration of the entire test */
Time taken for tests:3.234651 seconds
/* Number of requests completed */
Complete Requests:10
/* Number of failed requests */
Failed requests:0
Write errors:0
Non-2xx responses:10
Keep-alive requests:10
/* network traffic in the entire scene */
Total transferred:6020 bytes
/* The amount of HTML content transferred throughout the scene */
HTML transferred:2300 bytes
/* One of the most concerned indicators, equivalent to the number of transactions per second in LR, followed by mean in parentheses indicates that this is an average */
Requests per second:3.09 [#/sec] (mean)
/* Two of the most concerned indicators, equivalent to the average transaction response time in LR, followed by mean in parentheses indicates that this is an average */
Time per request:3234.651 [MS] (mean)
/* This does not know what the meaning, have to know friends please leave a message, thank you ^_^ * *
Time per request:323.465 [MS] (mean, across all concurrent requests)
/* Average traffic on the network per second can help eliminate the problem of extended response times due to excessive network traffic */
Transfer rate:1.55 [Kbytes/sec] Received
/* Decomposition of the time consumed on the network, the specific algorithm of each data is not very clear */
Connection Times (MS)
Min MEAN[+/-SD] Median max
Connect:20 318 926.1 30 2954
processing:40 2160 1462.0 3034 3154
waiting:40 2160 1462.0 3034 3154
Total:60 2479 1276.4 3064 3184
/* The following content is the response for all requests in the entire scene. There is a response time for each request in the scene, where 50 of the user response time is less than 3064 milliseconds, 60 of the user response time is less than 3094 milliseconds, and the maximum response time is less than 3184 milliseconds */
Percentage of the requests served within a certain time (MS)
50% 3064
66% 3094
75% 3124
80% 3154
90% 3184
95% 3184
98% 3184
99% 3184
100% 3184 (Longest request)
More information
AB is not as powerful as LR, but it's light enough, and if you just want to check the response of a module during development, or do some simple test, AB is a good choice-at least not to spend a lot of time learning about the complex functions of LR, let alone the License. 's Price.
The following is an explanation of the detailed parameters of AB, we are interested can study, recently not enough time to study, if a friend is interested in hoping to help translate the meaning of each parameter, there are questions to discuss also welcome here to reply ^_^
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
-A
auth-username :
password
Supply BASIC authentication credentials to the server. The username and password is separated by a, and sent on the wire :
base64 encoded. The string is sent regardless of whether the server needs it (i.e. , have 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 line to the Cookie:
request. The argument is typically in the form of a name =
value pair. 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) I T took to serve that percentage of the requests. This was usually more useful than the ' gnuplot ' file; As the results is already ' binned '.
-g
gnuplot-file
Write all measured values out as a ' gnuplot ' or TSV (Tab separate values) file. This file can easily is imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels is 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 HEAD
requests instead of GET
.
-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 is separated by a, and sent on the wire :
base64 encoded. The string is sent regardless of whether the proxy needs it (i.e. , have sent an 407 proxy authentication needed).
-q
When processing more than requests, ab
outputs a progress count on stderr
every 10% or requests or so. The -q
flag would suppress these messages.
-s
When compiled in ('ll show you) use the ab -h
SSL protected https
rather than the http
protocol. This feature is experimental and very rudimentary. You probably don't want to use it.
-S
Don't display the median and standard deviation values, nor display the Warning/error messages when the average and media N is more than one or both 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.
-T
content-type
Content-type header to use for POST data.
-v
verbosity
Set verbosity level-and 4
above prints information on headers, and above prints response codes 3
(404, $, etc.) , and 2
above prints warnings and info.
-V
Display version number and exit.
-w
Print out results in HTML tables. The Default table is the columns wide, with a white background.
-x
<table>-attributes
String to use as attributes for <table>
. Attributes is 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>