Apacheab testing tutorial to see how many requests your apache processes per second

Source: Internet
Author: User
It was late at night, but it was a weekend. after finishing this tutorial, I went to bed. first, I would like to introduce the apacheab (apacheab) performance testing tool, which is an ap

It was late at night, but it was a weekend. after finishing this tutorial, I went to bed. first, I would like to introduce apache AB (Apache AB) performance testing tool, which is a free built-in performance testing tool of apache, in the apache bin directory, it can simulate multiple concurrent requests, that is, it is mainly used to test how many requests your apache can process per second.

Format:AB [options] [http: //] hostname [: port]/path

Parameter options:

-A auth-username: password
Provides BASIC authentication trust to the server. The user name and password are separated by one and sent in base64 encoding format. This string is sent regardless of whether the server needs it (that is, whether the 401 authentication request code is sent.
-C concurrency
The number of requests generated at a time. The default value is one at a time.
-C cookie-name = value
Append a Cookie to the request: Row. The typical form is a parameter pair of name = value. This parameter can be repeated.
-D
Messages for "percentage served within XX [MS] table" are not displayed (supported for previous versions ).
-E csv-file
Generate a comma-separated (CSV) file that contains the time (in a subtle unit) required to process each percentage of requests (from 1% to 100%. This format has been "binary", so it is more useful than the 'gnupload' format.
-G gnuplot-file
Write all test results to a 'gnupload' or TSV (separated by tabs) file. This file can be easily imported to Gnuplot, IDL, Mathematica, Igor or even Excel. The title of the first behavior.
-H
Display usage.
-H custom-header
Append additional header information to the request. A typical form of this parameter is a valid header information line, which contains pairs of fields and values separated by colons (for example, "Accept-Encoding: zip/zop; 8bit ").
-I
Execute the HEAD request instead of GET.
-K
Enable the HTTP KeepAlive function, that is, to execute multiple requests in an HTTP session. By default, KeepAlive is not enabled.
-N requests
The number of requests executed in the test session. By default, only one request is executed, but the result is usually not representative.
-P POST-file
The file that contains the data to be POST.
-P proxy-auth-username: password
Provides BASIC authentication trust for a transit proxy. The user name and password are separated by one and sent in base64 encoding format. This string is sent regardless of whether the server needs it (that is, whether the 401 authentication request code is sent.
-Q
If the number of requests processed exceeds 150, AB will output a progress count in stderr every time it processes about 10% or 100 requests. This q mark can suppress this information.
-S
It is used for compiling (AB-h displays relevant information) using SSL protected https instead of http. This function is experimental and simple. It is best not to use it.
-S
The mean value and standard deviation value are not displayed, and no warning or error message is displayed when the mean value and the mean value are one to two times the standard deviation value. By default, the minimum, average, maximum, and other values are displayed. (To support previous versions ).
-T timelimit
The maximum number of seconds for testing. The implicit value is-n 50000. It limits the server test to a fixed total time. By default, there is no time limit.
-T content-type
The Content-type header used by the POST data.
-V verbosity
Set the details of the display information-4 or greater. the header information is displayed. 3 or a greater value can display the response code (404,200, etc.). 2 or a greater value can display warnings and other information.
-V
Show the version number and exit.
-W
Output results in HTML table format. By default, it is a table of the width of the two columns of the white background.
-X


-AttributesSet
Attribute string. This attribute is filled in





.-X proxy [: port]Use a proxy server for requests.-Y -AttributesSet Attribute string.-Z
-Attributes
Set
Attribute string

You don't have to worry about so many parameters,The two most basic options are c-n.

Example: AB-c 100-n 10000 http://www.phpddt.com/

-C 100: 100 concurrent requests each time
-N 10000: a total of 10000 requests are sent.

 

Alas, the network speed is too slow to log on to ssh. you can only test it in windows apache, but you mustNote::

(1). the url to be tested must be followed /.

(2) "-n" indicates the number of requests each time. by default, no more than 1024 requests are allowed. Otherwise, you must modify the system process limit.
(3). "-c" indicates the number of concurrent connections for one request. the default value cannot exceed 50000.


// Process 20 requests at the same time and run the www.phpddt.com/index.php file c:\> D: \ software \ wamp \ bin \ apache \ Apache2.2.21 \ bin \ AB-c 10-n 20 http://www.phpddt.com/This Is apachehe, 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.phpddt.com (be patient )..... done // apache version information Server Software: Apache/2.2.3 // Server host name Server Hostname: www.phpddt.com//server disconnected Server Port: 80 // test page Path Document Path: // Document size Document Length: 37826 bytes // Number of Concurrency Level: 10 // test duration Time taken for tests: 27.318 seconds // number of completed requests Complete requests: 20 // number of Failed requests: 0 // number of Write failures Write errors: 0 // Total network transmission volume Total transferred: 765280 bytes // html transferred: 756520 bytes // average number of transactions per second Requests per second: 0.73 [#/sec] (mean) // average transaction response Time per request: 13658.781 [MS] (mean) // average actual running Time per request: 1365.878 [MS] (mean, messaging SS all concurrent requests) // average network traffic per second, can help eliminate the problem of excessive network traffic resulting in prolonged response time Transfer rate: 27.36 [Kbytes/sec] partitioned Ed // decomposition of time consumed on the network Connection Times (MS) min mean [+/-sd] median maxConnect: 265 1218 1399.5 346 Processing: 2602 9957 3945.7 9033 14973 Waiting: 796 6868 3409.0 7631 11692 Total: 3204 11175 3709.0 10558 // the following is the request status Percentage of the requests served within a certain time (MS) 50% 10558/50% of children's shoes respond to www.phpddt.com for less than 10558 milliseconds. the following explanation is the same as 66% 13916 75% 14557 80% 14938 90% 15311 95% 18175 98% 18175 99% 18175 (longest request)

It is relatively simple to test and simulate apache AB. later, we will introduce pressure testing tools such as http_load and siege in the blog post.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.