Website Stress test (pressure measurement)

Source: Internet
Author: User
Tags connection reset server port

AB is the full name of the Apache Bench,apache with the AB command is very easy to use, you can directly in the Web server to launch test requests locally. AB for all the nature of testing is based on HTTP, so it can be said that AB for the Web server Software black box performance testing, all the data obtained and calculation results can be interpreted by HTTP;

Ab.exe is an Apache-brought stress test tool that has been installed after Apache

Basic usage:

Go to cmd console

Total number of ab.exe–n visits –c the number of people accessing (concurrent volume) the page URL of the access

To illustrate:

Ab.exe–n 1000–c http://locahost/1230test/newfile.php

Parameter description: (more important for bold) * The mean in parentheses below indicates that this is an average

   server software:web Server Software and version server Hostname: Requested address server port: Requested port document path: Requested page path document Length: Page size concurrency Level: Number of concurrent  time taken for tests: total duration of test   complete requests: Number of requests completed  Failed req Uests: Number of failed requests write errors: Write error Total transferred: Number of bytes transferred, HTML transferred:html bytes including header information for HTTP , actual page Pass bytes  Requests per second: number of requests processed per second, server throughput (important)   time per request: average, user avg. Request Latency that is, 100 people can request 1 times at a time.  times per request: Server average processing time  is the time a person needs to complete a request transfer rate: Average transfer speed ( Rate received per second)  


The following errors occur during the test
1) AB concurrency number can not be greater than the number of requests, will prompt
Ab:cannot use concurrency level greater than total number of requests

2) The number of requests cannot be more than 1024 by default and will prompt
Socket:too Many open files (24)
Use the Ulimit-n command to modify, for example: Ulimit-n 8192 (Sets the maximum number of files that the user can open simultaneously).

3) The concurrency number cannot be greater than 20,000 by default, prompting
Ab:invalid Concurrency [Range 0..20000]
Need to modify the Apache source code support directory under the AB.C file to find:
#define Max_concurrency 20000
Change the value of the macro definition to recompile and install Apache.

4) Tips
Apr_socket_recv:connection Reset by Peer (104)
Online said is apr-util some problems, not too stable, more than a few times just fine.

附:其他命令说明:
//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 produced at one time. The default is one at a time.

-c concurrency number of multiple requests to make

The maximum number of seconds the test takes. Its 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 TimeLimit Seconds to Max. Wait for responses

A file that contains the data that needs to be post.

-P postfile File containing data to POST

The Content-type header information used by the post data.

-T Content-type content-type header for POSTing

Setting the level of detail to display information-4 or greater displays header information, 3 or greater values can display response codes (404, 200, etc.), and 2 or greater values can display warnings and other information. -V Displays the version number and exits.

-V verbosity how much troubleshooting info to print

Outputs the result in the format of an HTML table. By default, it is a table with a two-column width on a white background.

-W Print out results in HTML tables

Executes the head request instead of get.

-I use HEAD instead of GET

-X attributes String to insert as table attributes

//

-Y attributes String to insert as TR attributes

//

-Z attributes String to insert as TD or TH attributes

-C Cookie-name=value attach a cookie to the request: line. Its typical form is a parameter pair of Name=value. This parameter can be repeated.

-C attribute Add cookie, eg. ' Apache=1234. (repeatable)

-H attribute Add arbitrary header line, eg. ' Accept-encoding:gzip '

Inserted after all normal header lines. (repeatable)

-A attribute Add Basic WWW authentication, the attributes

is a colon separated username and password.

-P Proxy-auth-username:password provides a Basic authentication trust to a transit agent. The user name and password are separated by a: and sent in Base64 encoded form. This string is sent regardless of whether the server is required (that is, if the 401 authentication requirement code is sent).

-P attribute Add Basic Proxy authentication, the attributes

is a colon separated username and password.

-X Proxy:port ProxyServer and port number to use

-V Print version number and exit

-K Use HTTP KeepAlive feature

-D do not show percentiles served table.

-S do not show confidence estimators and warnings.

-G filename Output collected data to gnuplot format file.

-e filename Output CSV file with percentages served

-H Display Usage information (this message)

Website Stress test (pressure measurement)

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.