Apachebench Using Tutorials

Source: Internet
Author: User
Tags response code

AB pressure Test AB is a performance testing tool for Apache Hypertext Transfer Protocol (HTTP). Its design intent is to depict the execution performance of the currently installed Apache. The main is to show how many requests you have installed Apache can process per second. Format:./ab [Options] [http://]hostname[:p Ort]/pathdetailed syntax: AB [-a auth-username:password] [-c concurrency] [-c Cookie-name=value] [-d] [-e csv-file] [-G gnuplot-file] [-h] [-H custom-header] [-i] [-K] [-N requests] [-p post-file] [-P proxy-auth-username:password] [-Q] [-S] [-S] [-t timelimit] [-t content-type] [-v verbosity] [-v] [-W] [-X <table>-attributes] [-X proxy[:p ORT]] [-y <TR>-attributes] [-Z <td>-attributes] [http://]hostname[:p Ort]/pathMany parameters, generally we use the-C and-The n parameter is available. For example:./ab-c +-N +http//127.0.0.1/index.phpthis represents processing 1000 requests at the same time and running the index.php file 1000 times. #/usr/local/xiaobai/apache2054/bin/ab-c +-N +http//127.0.0.1/index.htmlThe above results indicate that at the same time 1000 online requests (Concurrency level), the completion +Times of online requests, spent a total of6.859Seconds (Time taken forTests), so this program can be processed on average per second (requests per second)145.79an online request. This is Apachebench, Version2.0. A-dev < $Revision:1.121.2.12$> apache-2.0Copyright (c)1996Adam Twiss, Zeus technology LTD, http://www.zeustech.net/Copyright (c)1998-2002The Apache software Foundation, http://www.apache.org/Benchmarking127.0.0.1(Be patient) completed -requestscompleted $requestscompleted -requestscompleted -requestscompleted -requestscompleted -requestscompleted therequestscompleted -requestscompleted therequestsfinished +Requestsserver Software:apache/2.0. Wu                        //platform Apache version 2.0.54Server Hostname:127.0.0.1                                //Server Host nameServer Port: the                                            //Server PortDocument Path:/index.html//test the page documentDocument Length:1018bytes//Document SizeConcurrency Level: +                                        //Concurrency numberTime taken forTests8.188731Seconds//Duration of the entire testComplete requests: +                                        //number of requests completedFailed requests:0                                                //number of failed requestsWrite errors:0Total Transferred:1361581bytes//network traffic in the entire sceneHTML Transferred:1055666bytes//The amount of HTML content transferred throughout the scene//one of the most concerned indicators, equivalent to the number of transactions per second, followed by the mean in parentheses indicates that this is an averageRequests per second:122.12[#/sec] (mean)//We are most concerned about the indicator of the second, the average user request wait time, followed by the mean in parentheses that this is an averageTime per request:8188.731[MS] (mean)//This is the server average request processing timeTime per request:8.189[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 trafficTransfer Rate:162.30[kbytes/sec] receivedconnection times (ms) min mean[+/-SD] Median Maxconnect:4     646 1078.7     the        3291Processing:165     992 493.1    938        4712Waiting:118     934 480.6    882       4554Total:813     1638 1338.9  1093       7785//The decomposition of time consumed on the network, the specific algorithm of each data is not very clearPercentage of the requests served within a certain Time(MS) -%1093 the%1247 the%1373 the%1493 -%4061 the%439898%5608 About%7368 -%7785(longest request)//the response of all requests in the entire scene. Each request in the scene has a response time, where 50% of the user's response time is less than 1093 milliseconds, 60% of the user response time is less than 1247 milliseconds, and the maximum response time is less than 7785 milliseconds. Due to concurrent requests, the CPU is not actually processed at the same time, but instead is rotated on a per-request basis, so basically the first time of the request is approximately equal to the second time per request multiplied by the number of concurrent requests . /*------------------------Other examples---------------------------*/Let's say we're going toEcho. FCG do test, simulation +Online requests, and at the same time there are -Concurrent (concurrent) online requests, as long as they are executed in command-line mode (at the same time -Online request (Concurrency level), complete the +Online request), and spent a total of6.859Seconds (Time taken forTests), so this program can be processed on average per second (requests per second)145.79an online request. $ AB-N +-C -http//LOCALHOST/FCGI-BIN/ECHO.FCG/*------------------------parameter Description---------------------------*/-c concurrency The number of requests produced at one time.    The default is one at a time. -N Requests the number of requests executed in the test session.    By default, only one request is executed, at which point the result does not make sense. -A auth-Username:password provides basic authentication information to the server. Between the user name and password is a":"separated and will be sent in Base64 encoded form.    This string is sent regardless of whether the server is required (that is, if a 401 authentication requirement code is sent). -C cookie-name=value attaches one to the request"Cookies:"Head row. The typical form is name=A parameter pair of value.    This parameter can be repeated. -d does not show"percentage served within XX [MS] Table"message (support for previous versions). -E csv-fileproduces a comma-separated (CSV) file that contains the processing of each corresponding percent request (from 1% to 100%) the corresponding percentage time (in microseconds) that is required. Since this format has been" Binary", so than"gnuplot"format is more useful. -G gnuplot-fileWrite all test results to a"gnuplot"or a TSV (tab-delimited) file. This file can be easily imported into Gnuplot, IDL, Mathematica, Excel.    One of the first behavior headings. -h Displays the help information for the usage method. -H custom-The header appends additional header information to the request. A typical form of this parameter is a valid header information row that contains fields and values separated by colons, such as:"Accept-encoding:zip/zop;8bit"). -I perform a head request, not a get. -K enables the KeepAlive feature to execute multiple requests in an HTTP session.    The KeepAlive feature is not enabled by default. -P post-filethe file that contains the post data. -P proxy-auth-Username:password provides basic authentication information to a transit agent. The user name and password are provided by a":"separated and will be sent in Base64 encoded form.    This string is sent regardless of whether the server is required (that is, if a 407 proxy authentication requirement code is sent). -Q If the number of requests processed is greater than 150,ab per processing approximately ten% or 100 requests, a progress count is output at stderr. Thisthe Q tag can block this information. -s used in the compilation (AB-h will tell you that you are using SSL-protected HTTPS instead of the HTTP protocol.    This function is experimental, preferably not used. -S does not display median and standard deviation values, and a warning or error message is not displayed when the mean and median values are 1 to twice times the standard deviation value. By default, the minimum value is displayed/Mean/Values such as the maximum value. (Support for previous versions)-The maximum number of seconds that the T timelimit Test takes. The internal implied value is"- N 50000". It allows you to limit the testing of the server to a fixed total time.    By default, there is no time limit. -T content-type is used when the post data is"Content-type"header information. -v verbosity sets the level of detail that displays information, 4 or greater displays header information, and 3 or greater values can display the response code (404, 200, etc.), 2 or greater can display warnings and other information. -V Displays the version number and exits. -Woutputs the results in an HTML table format.    By default, it is a table with a two-column width on a white background. -X <table>-Attributes SettingsThe string for the <table> property. This property is filled in <table here >. -X proxy[:p ort] Use a proxy server for the request. -Y <TR>-Attributes Settings<TR>the string for the property. -Z <td>-Attributes SettingsThe string for the <td> property.

Apachebench Using Tutorials

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.