Web Stress test Tool Apache

Source: Internet
Author: User
Tags add format header net string version time limit port number

Many Web stress testing tools are now charged, but Apache brings a free stress test tool, the AB tool (command). Specifically in the Apache root directory in the bin directory, find a Ab.exe file is. Use it to make a rough test of how your program is performing.

The specific usage is as follows, extracts from the net. If there is a mistake, please correct me.

Format

AB [Options] [http://]hostname[:p Ort]/path

Parameters

-N requests number of requests to perform
The number of requests that were executed in the test session. By default, only one request is executed

-c concurrency number of multiple requests to make
The number of requests produced at a time. The default is one at a time.

-T TimeLimit Seconds to Max. Wait for responses
The maximum number of seconds that the test was made. Its intrinsic implied value is-n 50000. It can limit the testing of the server to a fixed total time. By default, there is no time limit.

-P postfile File containing data to POST
A file that contains the data that needs to be post.

-T Content-type content-type header for POSTing
The Content-type header information used by the post data.

-V verbosity how much troubleshooting info to print
Set the level of detail for 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.

-W Print out results in HTML tables
Output the results in an HTML table format. By default, it is a table with two columns of white background width.

-I use head instead of
Executes 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 attach a cookie to the request: line. 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 the 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 to a relay agent. The username and password are separated by one: and sent in the form of a base64 encoding. This string is sent regardless of whether the server needs it (that is, whether the 401 authentication requirement code is sent).

-X Proxy:port ProxyServer and port number to use
-V Print version number and exit
-K Use HTTP KeepAlive feature
-D don't show percentiles served table.
-S don't 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 the string that sets the property. There are a variety of statically declared fixed-length buffers in the flaw program. In addition, parsing of command-line arguments, server response headers, and other external input is simple, which can have undesirable consequences. It does not realize http/1.x completely; Only some ' expected ' response formats are accepted. The frequent use of STRSTR (3) can cause performance problems, that is, you may be testing AB rather than server performance.
A lot of parameters, generally we use the-C and-n parameters on it. For example:
Open cmd and enter the following code.
CD C:\Apache2.2\bin
Ab-n 1000-c Http://zf.guqin.com/index/index
This means processing 100 requests at a time and running 1000 index.php files. Here's what's printed.
This is apachebench, Version 2.0.41-dev < $Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 the Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (Be patient)
Completed Requests
Completed Requests
Completed Requests
Completed Requests
Completed Requests
Completed Requests
Completed Requests
Completed Requests
Completed 900 Requests
Finished 1000 requests
Server software:apache/2.2.8
Platform Apache version 2.2.8
Server Hostname:zf.guqin.com
Server Host Name
Server port:80
Server port
Document Path:/index.php
The page document for the test
Document length:1018 bytes
Document size
Concurrency level:1000
Concurrent number
Time taken for tests:8.188731 seconds
Duration of the entire test
Complete requests:1000
Number of requests completed
Failed requests:0
Number of failed requests
Write errors:0
Total transferred:1361581 bytes
The amount of network traffic in the whole scene
HTML transferred:1055666 bytes
The amount of HTML content transferred throughout the scene
Requests per second:122.12 [#/sec] (mean)
One of the most concerned indicators, equivalent to the number of transactions per second in LR, followed by the mean in parentheses indicates that this is an average
Time per request:8188.731 [MS] (mean)
The two most concerned indicators, equivalent to the average transaction response time in LR, followed by the mean in parentheses indicate that this is an average
Time/request:8.189 [MS] (mean, across all concurrent requests)
Average of actual elapsed time per request
Transfer rate:162.30 [Kbytes/sec] Received
The average traffic on the network per second can help eliminate the problem of excessive network traffic leading to longer response times
Connection Times (MS)
Min MEAN[+/-SD] Median max
Connect:4 646 1078.7 89 3291
processing:165 992 493.1 938 4712
waiting:118 934 480.6 882 4554
total:813 1638 1338.9 1093 7785
The decomposition of the time consumed on the network, the specific algorithm of each data is not very clear
Percentage of the requests served within a certain time (MS)
50% 1093
66% 1247
75% 1373
80% 1493
90% 4061
95% 4398
98% 5608
99% 7368
100% 7785 (Longest request)
The response of all requests in the entire scenario. Each request has a response time in the scenario where 50% of the user 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
Because the CPU is not actually processed at the same time for concurrent requests, it is rotated on a per-request basis, so it is basically the first time to request times equal to the second time of the request times multiplied by the number of concurrent requests.

Articles that you may be interested in

    • The top ten best web site performance testing software tools
    • PHP BOM Removal Tool, PHP bulk removal of BOM code
    • Classic dialogue between programmers and testers. These are foreign programmers summed up the share, called the global GM?
    • Web front-end Development Gadget collection
    • Polls show most Americans predict Obama will be re-elected
    • A summary of the method of JS judging browser type (IE Firefox chrome opera Safari)
    • JS get the scroll bar from the top of the browser, the bottom of the height, compatible with IE and Firefox
    • Software Test engineer Career introduction and planning


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.