AB (Apachebenchmark) concurrency test tool-PHP source code

Source: Internet
Author: User
The AB (Apachebenchmark) concurrent testing tool jumps to [1] [2] [3] [full screen preview]
Concurrency Level: 1000 Time taken for tests: 1.190 seconds # it took a total of 1000 seconds to process 1.19 concurrent requests Complete requests: 1000 # The amount of requests processed Failed requests: 0 # Number of request failures Write errors: 0Non-2xx responses: 1000 Total transferred: 164000 bytes # Total traffic transferred HTML transferred: 0 bytesRequests per second: 840.58 [#/sec] (mean) # An average request takes 840.58 milliseconds, which is equivalent to the number of transactions per second in LR. the mean in the brackets below indicates that this is an average Time per request: 1189.651 [MS] (mean) # equivalent to the average transaction response Time in LR, the mean in the brackets below indicates that this is an average Time per request: 1.190 [MS] (mean, average SS all concurrent requests) # The average ms of the actual running time of each request is millisecond Transfer rate: 134.62 [Kbytes/sec] received # the transmission rate, which helps to eliminate the problem of long response time due to excessive network traffic

2.[Code]Detailed AB parameter descriptionJump to [1] [2] [3] [full screen preview]

AB [options] [http [s]: //] hostname [: port]/pathOptions are: # number of requests executed in the test session, by default, only one request is executed-n requests Number of requests to perform # The Number of requests generated at a time, that is, the Number of requests sent at the same time, the default value is one-c concurrency Number of multiple requests to make # the maximum Number of seconds for the test. the default value is no time limit .... the internal implicit value is [-n 50000], which can limit the server test to a fixed total time-t timelimit Seconds to max. wait for responses-B windowsize Size of TCP send/receive buffer, in bytes # contains the File for POST data-p postfile File containing data to POST. remember also to set-T-u putfile File containing data to PUT. remember also to set-T # Content-type header used by POST data-T content-type Content-type header for POSTing, eg. 'application/x-www-form-urlencoded 'Default is 'text/plain '# sets the display details. if the value is 4 or greater, the header information is displayed, 3. a response code (404,200, etc.) can be displayed for a greater value ), 2 or a greater value can display warnings and other information-v verbosity How much troubleshooting info to print # output results in the form of HTML tables, by default, a table with two columns of width in the white background-w Print out results in HTML tables # executes the HEAD request instead of GET-I Use HEAD instead of GET # settings
 
  
Attribute string, which is filled in
 
-X attributes String to insert as table attributes # settings Attribute String-y attributes String to insert as tr attributes # settings
Attribute String-z attributes String to insert as td or th attributes # attaches a Cookie row to the request. the typical format is name = value parameter pair, this parameter can be repeated-C attribute Add cookie, eg. 'Apache = 100 '. (repeatable) # append additional header information to the request. this parameter is typically a valid header information line, it contains pairs of fields and values separated by colons (for example, "Accept-Encoding: zip/zop; 8bit")-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip' Inserted after all normal header lines. (repeatable) # HTTP Authentication, separated by A colon (:) to pass the user name and password-a attribute Add Basic WWW Authentication, the attributes are A colon separated username and password. # provide BASIC authentication trust to a transit proxy. the user name and password are separated by a colon, sent in base64 encoding # this string will be sent-P attribute Add Basic Proxy Authentication regardless of whether the server needs it (that is, whether or not the 401 Authentication requirement code is sent, the attributes are a colon separated username and password. # use the proxy server-X proxy: port Proxyserver and port number to use for requests # display the version number and exit-V Print version number and exit # enable the HTTP KeepAlive function, that is, multiple requests are executed in an HTTP session, default: do not enable KeepAlive feature-k Use HTTP KeepAlive feature # Do not display messages for "percentage served within XX [MS] table" (supported for previous versions) -d Do not show percentiles served table. # no warning or error information is displayed when the mean value and the standard deviation value are not displayed, and the mean value are one to two times the standard deviation value, by default, the minimum, average, and maximum values are displayed (supported by previous versions)-S Do not show confidence estimators and warnings. # 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 first behavior title-g filename Output collected data to gnuplot format file. # generate a comma-separated (CSV) file that contains the corresponding percentage (in subtle units) required to process each request (from 1% to 100%) time # because this format has been "binary", it is more useful than the 'gnuplot' format-e filename Output CSV file with percentages served-r Don't exit on socket receive errors. # Display usage-h Display usage information (this message)-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)-f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)

3.[Code]Detailed AB resultsJump to [1] [2] [3] [full screen preview]

AB-n 1000-c 10 http://www.libs.org.cn/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 complete (be patient) Completed 100 requestsCompleted 200 requestsCompleted 300 requestsCompleted 400 requestsCompleted 500 requestsCompleted 600 requestsCompleted 700 bytes 800 bytes 900 requests # Name of the tested Web service software, it comes from the header information of the HTTP response data (Apache-Coyote/1.1, that is, Tomcat) Server Software: Apache-Coyote/1.1 # Server host name, server Hostname: epay.10010.com # listening Port Server Port: 443SSL/TLS Protocol: TLSv1/SSLv3, DHE-RSA-AES256-SHA, 2048,256 # Path of the file to which the URL is requested, that is, the requested resource Document Path:/# Length of the HTTP response body, excluding the response header, that is, the Length of the header information in the HTML response data in Total transferred is subtracted. Document Length: 0 bytes # Concurrency (set by the-c attribute) Concurrency Level: 10 # Time taken to execute all the requests, that is, the duration of the test. Time taken for tests: 26.121 seconds # number of completed requests Complete requests: 1000 # Number of Failed requests: 0 Write errors: 0Non-2xx responses: 1001 # The total number of network transmissions in the entire scenario, that is, the total number of response data for all requests, total transferred: 299299 bytes # The amount of HTML content transmitted throughout the scenario, that is, the body length of response data in all requests, excluding the length of header information HTML transferred: 0 bytes # throughput: the number of requests processed per second, which is equivalent to the number of transactions per second in LR. the mean in the brackets indicates that this is an average value and its value is Complete requests/Time taken for testsRequests per second: 38.28 [#/sec] (mean) # average request wait Time: equivalent to the average transaction response Time in LR; value: Time taken for tests/(Complete requests/Concurrency Level) time per request: 261.206 [MS] (mean) # average server request processing Time, that is, the average actual running Time of each request, with a value of Time per request/Concurrency LevelTime per request: 26.121 [MS] (mean, internal SS all concurrent requests) # average network traffic per second, that is, the length of data these requests get from the server within the unit, the value is (Total transferred/Time taken for tests /) 1024 # This statistical option can clearly indicate the demand for the outbound bandwidth of the server when the processing capability reaches the limit # it can help to eliminate the problem of excessive network traffic resulting in prolonged response time Transfer rate: 11.19 [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 maxConnect: 85 222 101.0 205 1224 Processing: 12 38 23.4 34 151 Waiting: 12 37 23.5 33 151 Total: 144 259 100.9 244 # response of all requests in the entire scenario, in the scenario, each request has a response Time # The following result shows that 50% of the user response Time (that is, the request processing Time. here the processing Time is Time per request) less than 244 milliseconds # 66% of user response time is less than 252 milliseconds, and the maximum response time is less than 1268 milliseconds # for concurrent requests, the CPU does not actually process at the same time, it is rotated one by one based on the Time slice obtained by each request. # therefore, the first Time per request is basically equal to the second Time per request Time multiplied by the number of concurrent requests Percentage of the requests served within a certain. time (MS) 50% 244 66% 252 75% 254 80% 255 90% 260 95% 481 98% 665 99% 686 100% 1268 (longest request)

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.