Chapter 1 Introduction
ab is the Apache HyperText Transfer Protocol (HTTP) performance testing tools. It is designed to depict the execution performance of Apache currently installed mainly show you install Apache can handle the number of requests per second.
Chapter II Description
ab [-A auth-username ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -ecsv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -nrequests ] [ -p POST-file ] [ -P proxy-auth-username ] [ -q ] [ -s ] [ -S ] [-t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x<table>-attributes ] [ -X proxy[] ] [ -y <tr>-attributes ] [ -z<td>-attributes ] [http://]hostname[:port]/path
l -A auth-username:password
BASIC authentication server provides trust. A user name and password of: spaced apart, and transmits base64 encoded. Regardless of whether the server needs (i.e., whether to send the authentication needed 401), this string is sent.
l -c concurrency
Generating a number of requests. Default is one.
l -C cookie-name=value
A request for additional Cookie: line. It is typically in the form of a parameter name = value pairs. This parameter can be repeated.
l -d
Does not display the "percentage served within XX [ms] table" message (to provide support for the previous version).
l -e csv file
Generating a comma-separated (CSV) file, which contains the request processing required for each respective percentage (from 1% to 100%) of the corresponding percentage (in units of microsecond) time. Since this format has "binary" and so than the 'gnuplot' format more useful.
l -g gnuplot-file
All the test results are written to a 'gnuplot' or TSV (Tab separate) file. This file can be easily imported into Gnuplot, IDL, Mathematica, Igor or even Excel. One of the first acts of the title.
l -h
Display use.
l -H custom-header
Additional request for additional header information. This parameter is typically in the form of a valid header line, which contains the values for the field and separated by a colon (e.g., "Accept-Encoding: zip / zop; 8bit").
l -i
Do HEAD requests instead of GET.
l -k
HTTP enabled the KeepAlive function, i.e., execute a plurality of requests in the HTTP session. By default, no KeepAlive.
l -n requests
The number of requests performed in the test session. By default, perform a single request, but usually as a result does not have a significant representatives.
l -p POST-file
POST file contains the required data.
l -P proxy-auth-username:password
Supply BASIC Authentication credentials to a proxy. A user name and password of: spaced apart, and transmits base64 encoded. Regardless of whether the server needs (i.e., whether to send the authentication needed 401), this string is sent.
l -q
If the number of requests processed is greater than 150, ab per treatment to about 10%, or 100 request, it outputs a progress count stderr. This can suppress -q tag information.
l -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. Best not to use.
l -S
Away from the median and the standard value is not displayed, and when the mean values and the standard values departing from 1 to 2 times, no warning or error messages. By default, to the min / avg / max. (To provide support for the previous version).
l -t timelimit
The maximum number of seconds that the tests carried out. Its value is hidden inside -n 50000. It enables testing of the server is limited to within a fixed total time. By default, there is no time limit.
l -T content-type
Content-type header information used by POST data.
l -v verbosity
Set verbosity level - 4 or more header information value is displayed, 3 or a larger value may be displayed response code (404, 200, etc.), two or more prints warnings and other information.
l -V
Display version number and exit.
l -w
The output format of HTML table. By default, it is the white background of two widths of a table.
l -x <table>-attributes
Settings <table> string property. This property is populated <table here>.
l -X proxy[:port]
A request to use a proxy server.
l -y <tr>-attributes
Settings <tr> string property.
l -z <td>-attributes
Set string <td> properties.
Chapter III Usage
Usage: ab -n all requests -c concurrent test url
Example:
E: \ is \ ab.exe -c 100 -n 1000 http://192.168.1.123/exam/
Chapter IV Test Results
This is ApacheBench, Version 2.0.41-dev<$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, ZeusTechnology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache SoftwareFoundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: Apache / 2.0.54 // platform apache version 2.0.54
Server Hostname: 127.0.0.1 // server hostname
Server Port: 80 // server port
Document Path: /index.html.zh-cn.gb2312 // test page document
Document Length: 1018 bytes // size of the document
Concurrency Level: 1000 // concurrent
Time taken for tests: 8.188731 seconds // entire test duration
Complete requests: 1000 // number of requests completed
Failed requests: 0 // number of failed requests
Write errors: 0
Total transferred: 1361581 bytes // transfer over the network of the whole scene
HTML transferred: 1055666 bytes // HTML content over the entire scene
Requests per second: 122.12 [# / sec] (mean) // number of transactions per second
Time per request: 8188.731 [ms] (mean) // average transaction response time
// average of the actual running time for each request
Time per request: 8.189 [ms] (mean, acrossall concurrent requests)
// traffic on the network per second, can help rule out the existence of excessive network traffic cause extended response time problems
Transfer rate: 162.30 [Kbytes/sec] received
// decomposition consume time on the network, the data specific algorithm is not very clear
Connection Times (ms)
min mean[+/-sd] median max
Connect: 4 646 1078.7 89 3291
Processing: 165 992 493.1 938 4712
Waiting: 118 934 480.6 882 4554
Total: 813 1638 1338.9 1093 7785
// throughout the scene in response to the requests of all. In the scene has a response time of each request, wherein 50% of the user response time is less than 1093 milliseconds, 60% of the user response time is less than 1247 ms, the maximum response time is less than 7785 ms
Percentage of the requests served within acertain time (ms)
50% 1093
66% 1247
75% 1373
80% 1493
90% 4061
95% 4398
98% 5608
99% 7368
100% 7785 (longest request)
Reproduced in: https: //www.cnblogs.com/james1207/p/3315411.html