1, 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 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)
2, the pressure test example:
Enter the command PS D:\wamp\bin\apache\Apache2. 2.21\bin>. \AB-N1000-C10 http://localhost/index.php
result parameter explanation:
This is apachebench, 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)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests
Server software:microsoft-httpapi/2.0
Server hostname:192.168.0.10
Server port:80
Document Path:/
Document length:315 bytes The body length of the HTTP response data
Concurrency level:800
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)
With follow-up ...
Related information:
about the AB test method in website testing:http://www.poluoluo.com/jzxy/201211/188050.html
AB Output information interpretation and failed requests cause analysis:http://www.ttlsa.com/web/ analysis-of-ab-output-information-interpretation-and-failed-requests/
Introduction to Apache AB stress testing