Apache lightweight Performance Testing Tool

Source: Internet
Author: User
Tags response code

At ordinary times, some performance tests are required. Simple performance tests can be replaced by AB, rather than using heavyweight tools such as LR.

This article briefly introduces the use of AB tool and result analysis. Take notes for future reference.

1. Installation: to use AB, you must first install Apache, which is an Apache benchmark tool, under the Apache installation directory.
2. Use:

Format:./AB [Options] [http: //] hostname [: Port]/path
Parameter description:
-N requests number of requests to perform
// The number of requests executed in the test session. By default, only one request is executed.
-C concurrency number of multiple requests to make
// The number of requests generated at a time. The default value is one at a time.
-T timelimit seconds to max. Wait for responses
// 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.
-P postfile file containing data to post
// File that contains the data to be post.
-T Content-Type Header for posting
// The Content-Type Header used by the post data.
-V verbosity how much troubleshooting info to print
// Set the details of the display information-4 or a greater value will display the header information, 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 displays the version number and exits.
-W print out results in HTML tables
// Output results in HTML table format. By default, it is a table of the width of the two columns of the white background.
-I use head instead of get
// Execute the head request 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 attribute add cookie, eg. 'apache = 1234. (repeatable)
//-C cookie-name = value attaches a cookie to the request: Row. The typical form is a parameter pair of name = value. This parameter can be repeated.
-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
Are a colon separated username and password.
-P attribute add basic proxy authentication, the attributes
Are a colon separated username and password.
//-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.
-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)
//-Attributes: Specifies the attribute string. The defect program contains various static declared fixed-length buffers. In addition, parsing command line parameters, server response headers, and other external inputs is also simple, which may have adverse consequences. It does not fully implement HTTP/1.x; only accept some 'preview' response formats. Frequent use of strstr (3) may cause performance problems, that is, you may be testing the performance of AB rather than the server.

There are many parameters. Generally we can use the-C and-N parameters. For example:

Http://XXX.php./AB-C 3-N 3

This indicates processing three requests simultaneously and running the XXX. php file three times.
# AB-C 3-N 3 http://XXX.php

The following is an example of a real request:

Benchmarking test.web.com (Be patient) ...... done

 

Server Software: nginx/1.1.7

// Apache version 1.1.7

Server Hostname: test10.web.com

// Server host name

Server port: 8037

// Server port

Document path:/tools/login. php

// URL of the test page

Document length: 5614 bytes

// Document size

Concurrency level: 3

// Concurrency

Time taken for tests: 5.936210 seconds

// Test duration

Complete requests: 3

// Number of completed requests

Failed requests: 2

// Number of failed requests

(CONNECT: 0, Length: 2, exceptions: 0)

Write errors: 0

Total transferred: 17273 bytes

// Network transmission volume in the entire scenario

HTML transferred: 16835 bytes

// The amount of HTML content transmitted throughout the scenario

Requests per second:0.51 [#/sec] (mean)

// One of the most important indicators is the transactions per second TPS in LR. The mean in the brackets below indicates that this is an average value.

Time per request:5936.210 [MS] (mean)

// The second indicator that everyone cares most about is equivalent to the average transaction response time in LR. The mean in the brackets below indicates that this is an average value.

Time per request: 1978.737 [MS] (mean, internal SS all concurrent requests)

// Average actual running time of each request

Transfer Rate: 2.70 [Kbytes/sec] canceled ed

// The average network traffic per second can help eliminate the problem of excessive network traffic resulting in prolonged Response Time

Connection times (MS)

Min mean [+/-SD] median Max

Connect: 0 0 0.0 0 0 // time consumed to establish a connection

Processing: 5926 5930 5.3 5932 5936 // time consumed by processing requests

Waiting: 5926 5929 4.8 5931 5935 // time spent waiting for server processing

Total: 5926 5930 5.3 5932 5936 // time consumed throughout the process

// Decomposition of time consumed on the network

Percentage of the requests served within a certain time (MS)

50% 5928

66% 5928

75% 5936

80% 5936

90% 5936

95% 5936

98% 5936

99% 5936

100% 5936 (longest request)

// Response of all requests in the entire scenario. In the scenario, each request has a response time, of which 50% of the user response time is less than 5928 milliseconds, 66% of the user response time is less than 5928 milliseconds, and the maximum response time is less than 5936 milliseconds.

 

From: http://blog.csdn.net/xifeijian/article/details/25166031



Apache lightweight Performance Testing Tool

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.