Use Apache AB tool for stress testing and apache stress testing

Source: Internet
Author: User

Use Apache AB tool for stress testing and apache stress testing

AB command Principle
The Apache AB command simulates multi-thread concurrent requests, tests server load pressure, and tests the pressure on other Web servers such as nginx, lighthttp, and IIS.
The AB tool that comes with Apache is very easy to use (the PHP environment is the WAMP integrated environment, and the AB tool is located at D: \ wamp \ bin \ apache \ Apache2.2.21 \ bin. The AB command has very low requirements on the computer that sends out the load. It does not occupy a lot of CPU or memory, but it will cause a huge load on the target server, therefore, it is an essential medicine for some DDOS attacks. Exercise caution when using the SDK. Otherwise, the target server will directly crash due to memory consumption, and the server will have to be restarted.

In the case of insufficient bandwidth, it is best to test on the local machine. We recommend that you use another or multiple servers in the Intranet for testing through the Intranet. The data obtained in this way will be much more accurate. Remote stress tests on web servers often have unsatisfactory results (due to excessive network latency or insufficient bandwidth)

Download and install:
Http://mirror.bit.edu.cn/apache//httpd/binaries/win32? C = M; O =
Find httpd-2.2.21-win32-x86-no_ssl.msi

Parameter documentation: 
Http://httpd.apache.org/docs/2.2/programs/ AB .html

 

Run:
In Windows, open the cmd command line window and go to the bin directory of the apache installation directory.
Cd C: \ Program Files (x86) \ Apache Software Foundation \ Apache2.2 \ bin

Type the following command:
AB-n 800-c 800 http: // 192.168.0.10/
(-N sends 800 requests,-c simulates 800 concurrent requests, and equivalent to 800 concurrent accesses, followed by the test url)

AB-t 60-c 100 http: // 192.168.0.10/
Send 100 requests at a time within 60 seconds.

// If you need to include parameters in the url, do this
AB-t 60-c 100-T "text/plain"-p p.txt http: // 192.168.0.10/hello.html
P.txt is in a directory with AB .exe
You can write parameters in p.txt, such as p = wdp & fq = 78.
 


Result parameter explanation: 
This is apachetings, 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 192.168.0.10 (be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Finished 800 requests

 

Server Software: Microsoft-HTTPAPI/2.0 indicates the name of the tested Web Server Software.
Server Hostname: 192.168.0.10 indicates the requested URL Host Name
Server Port: 80 indicates the listening Port of the tested Web Server software.

Document Path:/indicates the absolute root Path in the request URL. With the extension name of the file, we generally know the type of the request.
Document Length: 315 bytes indicates the body Length of the HTTP Response Data

Concurrency Level: 800 indicates the number of concurrent users. This is one of the parameters we set.
Time taken for tests: 0.914 the Time it takes for seconds to process all these requests
Complete requests: 800 completed requests
Failed requests: 0 Failed requests
Write errors: 0
Non-2xx responses: 800
Total transferred: 393600 bytes Total network transmission volume
HTML transferred: 252000 bytes HTML content transmission volume
Requests per second: 875.22 [#/sec] (mean) Throughput-number of Requests per second
Time per request: 914.052 [MS] (mean) the Time the server receives the request to respond to the page
Time per request: 1.143 [MS] (mean, average SS all concurrent requests) Average Time consumed for each concurrent request
Transfer rate: 420.52 [Kbytes/sec] The average network traffic of the received per second can help eliminate the problem of long response time due to excessive network traffic


Decomposition of time consumed on the network:
Connection Times (MS) min mean [+/-sd] median max
Connect: 0 1 0.5 1 3
Processing: 245 534 125.2 570 682
Waiting: 11 386 189.1 409 669
Total: 246 535 125.0 571

The response of all requests in the entire scenario. Each request has a response time in the scenario.
Among them, 50% of the user response time is less than 571 milliseconds
80% of user response time is less than 652 milliseconds
The maximum response time is less than 684 milliseconds
Percentage of the requests served within a certain time (MS)
50% 571
66% 627
75% 646
80% 652
90% 666
95% 677
98% 681
99% 682
100% 684 (longest request)

This part of data is used to describe the distribution of each request processing Time. For example, in the above test, 80% of the request processing Time cannot exceed 6 ms. This processing Time refers to the previous Time per request, that is, the average processing time of each request for a single user.

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.