apache own performance testing tools
ab is the full name of ApacheBench, is attached to a small Apache tools, specialized HTTP Server for the benchmark testing, can be simulated at the same time a number of concurrent requests. Some time ago to see the company's developers also use it for some testing, looks good, is simple and easy to use, so spend some time today look.
Through the following example of a simple and comments, I believe we can more easily understand the use of this tool.
A simple example
/ * In this example the start, I implemented a command ab-n 10-c 10 . The meaning of this command is to start ab, to 10 request to send (-n 10), and each time I send 10 requests (-c 10) - in other words made over time. Then the following is the output of the test report ab, the red part of the notes I added. * /
Basic Usage:
All ab-n number-c concurrent request number of test url
ab-n 10-c 10 : / / www.google.com/
This is ApacheBench, Version 2.0.40-dev <$ Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 1997-2005 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.google.com (be patient )..... done
Server Software: GWS/2.1 (server name)
Server Hostname: (Domain name)
Server Port: 80
Document Path: /
Document Length: 230 bytes # request Document Size
Concurrency Level: 10 # number of concurrent
Time taken for tests: 3.234651 seconds / * duration of the entire test # All requests to complete time-consuming
Complete requests: 10 / * number of requests to complete * / # All requests for a few
Failed requests: 0 / * number of failed request * /
Write errors: 0
Non-2xx responses: 10
Keep-Alive requests: 10
Total transferred: 6020 bytes / * the whole scene of network traffic * / # total transmission size
HTML transferred: 2300 bytes / * the entire scene in the amount of HTML content * /
Requests per second: 3.09 [# / sec] (mean) # the number of requests per second (average)
Time per request: 3234.651 [ms] (mean) # concurrent requests each time (all complicated)
Time per request: 323.465 [ms] (mean, across all concurrent requests) # every request time (concurrent average)
/ * # Per second transfer rate of the average flow on the network, can help rule out the existence of network flow excessive lead time to respond to the problem * /
Transfer rate: 1.55 [Kbytes / sec] received 6020 / (1.55 * 1024) = 6020/1587.2 = 3.79 (sec)
/ * Network decomposition time consumption, the specific algorithm of the data is not very clear * /
Connection Times (ms) # connection time
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 for the entire scene in response to the situation of all requests. In each scene has a response time of the request, of which 50% of the user response time of less than 3064 ms, 60% of the user response time of less than 3094 milliseconds, the largest response time of less than 3184 ms * /
Percentage of the requests served within a certain time (ms)
50% 3064
66% in 3094
75% 3124
80% 3154
90% 3184
95% 3184
98% 3184
99% 3184
100% 3184 (longest request)
Detailed parameters
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 is the Apache HyperText Transfer Protocol (HTTP) performance testing tools. Their design intent is to depict the current The implementation of the Apache performance, mainly the installation of Apache shows that you can handle per second, the number of requests.
OPTIONS
-A auth-username: password
Supply BASIC Authentication credentials to the server. The user name 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 (ie, has sent an 401 authentication needed).
BASIC authentication server to provide confidence. User name and password by a: separated and sent to base64 encoding. Regardless of whether the server (that is, whether the certification needs to send a 401 code), this string will be sent.
-c concurrency
Number of multiple requests to perform at a time. Default is one request at a time.
Generated a number of requests. The default is the first one.
-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.
Attached to the request of a Cookie: line. Its typical form of name = value of a parameter right. Can repeat this parameter.
-d Do not display the "percentage served within XX [ms] table".
(legacy support).
Do not show "percentage served within XX [ms] table" news (for the previous version to provide support).
-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'.
A comma-separated (CSV) file, which includes dealing with the request of the percentage of each corresponding need (from 1% to 100%) of the corresponding percentage (in milliseconds) time. As a result of this format is "binary" and therefore than the 'gnuplot' format more useful.
-g gnuplot-file
Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.
All the test results to write a 'gnuplot' or TSV (to Tab delimited) file. This document can be easily imported into Gnuplot, IDL, Mathematica, Igor or even Excel,. The title of the first act.
-h Display usage information.
Show Method.
-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 (ie, "Accept-Encoding: zip / zop; 8bit").
On the first request for additional information attached. The typical form of this parameter is a valid header line, which contains a colon-separated fields and the value of (such as, "Accept-Encoding: zip / zop; 8bit").
-i Do HEAD requests instead of GET.
The implementation of HEAD requests, not GET.
-k Enable the HTTP KeepAlive feature, ie, perform multiple
requests within one HTTP session. Default is no KeepAlive.
HTTP KeepAlive feature is enabled, that is, in a conversation in the implementation of a number of HTTP requests. Default KeepAlive feature is enabled.
-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 enchmarking results.
In the test session by the number of the implementation of the request. By default, only the implementation of a request, but usually the results are not representative of significance.
-p POST-file
File containing data to POST.
POST includes the need to document the data.
-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 (ie, has sent an 407 proxy authentication needed ).
Of a transit BASIC authentication to provide confidence. User name and password by a: separated and sent to base64 encoding. Regardless of whether the server (that is, whether the certification needs to send a 401 code), this string will be sent.
-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.
If we do not handle the request of more than 150, ab each handle about 10% or 100 requests, the stderr output in a progress count. The-q tag information can be inhibited.
-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.
Used to compile in (ab-h will display relevant information) use the SSL protected https, not http agreement. This feature is experimental, and it is very simple. Do not use the best.
-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 ).
Do not show departure from the mean value and standard value, but also in the mean and median values as the standard from 1-2 times, do not display a warning or error message. By default, it will show the minimum / average / maximum values and so on. (For previous versions provide 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.
Tests carried out by the largest number of seconds. Implied value of its in-house-n 50000. It can test the server to a fixed time within the total. By default, no time limit.
-T content-type
Content-type header to use for POST data.
POST data used by Content-type header information.
-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.
Set shows the level of detail of information - 4 or greater value will display the first information, the value of 3 or greater response code can be displayed (404, 200, etc.), 2 or greater value can display a warning and other information.
-V Display version number and exit.
Display version number and exit.
-w Print out results in HTML tables. Default table is two columns wide, with a white background.
To HTML format for output. By default, it is the white background of a width of two tables.
-x <table>-attributes
String to use as attributes for <table>. Attributes are inserted <table here>.
<table> String attribute set. This property <table这里> be filled.
-X proxy [: port]
Use a proxy server for the requests.
Use a proxy server on the request.
-y <tr>-attributes
String to use as attributes for <tr>.
<tr> String attribute set.
-z <td>-attributes
String to use as attributes for <td>.
<td> String attribute set.
BUGS
There are various statically declared buffers of fixed length. Combined with the lazy parsing of the command line arguments, the response headers from the server and other external inputs, this might bite you. It does not implement HTTP/1.x fully; only accepts some 'expected' forms of responses. The rather heavy use of strstr (3) shows up in profile, which might indicate a performance problem; ie, you would measure the ab performance rather than the server's.
Procedures in a variety of fixed-length static declaration of the buffer zone. In addition, command-line parameters, the response from the server first, and other external input is also very simple analysis, that there may be some adverse consequences. It does not achieve a complete HTTP/1.x; only accept certain 'desired' response format. strstr (3) the frequent use may lead to performance problems, that is, you may be ab rather than in testing the performance of the server.
/ * # Concurrent requests each time (all complicated)
We are most concerned about the indicators of the second, which is equivalent to the LR average response time of affairs, followed in parentheses mean that this is a mean value * /
/ * Number # requests per second (average) we are most concerned about one of the indicators, which is equivalent to LR in a number of second affairs, followed in parentheses mean that this is an average of *
Tags: google (RSS), apache software foundation (RSS), server port (RSS), performance testing tools (RSS), document length (RSS), concurrent requests (RSS), server hostname (RSS), document path (RSS), test report (RSS), zeus technology ltd (RSS), adam twiss (RSS), domain name server (RSS), content requests (RSS), request document (RSS), test url (RSS), request number (RSS), failed requests (RSS), document size (RSS), number c (RSS), network traffic (RSS)
Permalink: http://www.codeweblog.com/apache-own-performance-testing-tools/





















