AB command principle
Apache's AB commands simulate multi-threaded concurrent requests, test server load pressures, and test the pressure of Nginx, Lighthttp, IIS and other Web servers.
The AB tool included with Apache (the PHP environment used is the WAMP integration environment, the AB tool is located in D:\wamp\bin\apache\Apache2.2.21\bin) is very easy to use. The AB command is very low on the computer that emits the load, does not consume a lot of CPU, and does not take up too much memory, but it can cause huge load to the target server, so it is a necessary medicine for some DDoS attacks, which is suitable for all ages. You should use caution when using your own. Otherwise, too much load at a time, causing the target server directly due to memory loss of light, and have to hard restart, not worth the candle.
In the case of insufficient bandwidth, it is best to test this machine, it is recommended to use the intranet of another or more servers through the intranet to test, so that the data obtained, the accuracy will be much higher. Remote Web server stress testing, often ineffective (because the network latency is too large or insufficient bandwidth)
Download the installation:
; o=a
Find Httpd-2.2.21-win32-x86-no_ssl.msi
parameter Documentation:
Run:
Under Windows System, open the CMD Command Line window and navigate to the Apache installation directory under the bin directory
CD C:\Program Files (x86) \apache software Foundation\apache2.2\bin
Type the command:
Ab-n 800-c http://192.168.0.10/
(-N Issues 800 requests,-C simulates 800 concurrent, quite 800 people concurrently, followed by test URL)
Ab-t 60-c http://192.168.0.10/
Requests are made within 60 seconds, 100 requests at a time.
If you need to take 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 and Ab.exe in a directory
P.txt can write parameters, such as p=wdp&fq=78
result parameter explanation:
This is apachebench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus technology LTD,
Licensed to the Apache software Foundation,
Benchmarking 192.168.0.10 (Be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests
Server software:microsoft-httpapi/2.0 represents the Web server software name being tested
Server hostname:192.168.0.10 represents the requested URL host name
Server PORT:80 indicates the listening port of the Web server software being tested
Document Path:/represents the root absolute path in the requested URL, with the suffix of the file, we can generally understand the type of the request
Document length:315 bytes represents the body length of the HTTP response data
Concurrency level:800 represents the number of concurrent users, which is one of the parameters we set
Time taken for tests:0.914 seconds all of the times that these requests are processed to complete
Complete requests:800 number of completed requests
Failed requests:0 number of failed requests
Write errors:0
Non-2xx responses:800
Total transferred:393600 Bytes Network traffic
HTML transferred:252000 bytes HTML content transfer Volume
Requests per second:875.22 [#/sec] (mean) throughput-number of requests per second
Time per request:914.052 [MS] (mean) server receives request, Response page takes
Time per request:1.143 [MS] (mean, across all concurrent requests) average consumption of each request concurrently
Transfer rate:420.52 [Kbytes/sec] received average per second network traffic can help you troubleshoot problems with extended response times 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 684
The response of all requests in the entire scene. Each request has a response time in the scene
Where 50% of the user response time is less than 571 milliseconds
80% User response time is less than 652 milliseconds
Maximum response time of 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 the data is used to describe the distribution of each request processing time, such as the above test, 80% of the request processing time is not more than 6ms, this processing time refers to the preceding times per request, that is, for a single user, the average processing time per requests.