AB is the abbreviation for apachebench.
The AB command creates multiple concurrent access threads, simulating multiple visitors accessing a URL address at the same time. Its test target is URL-based, so it can be used to test the load pressure of Apache, as well as other Web servers such as Nginx, Lighthttp, Tomcat, and IIS.
The AB command is very low on the computer that emits the load, and it does not occupy a high CPU or consume a lot of memory. But it will cause a huge load on the target server, which works like a CC attack. You also need to be aware of your own testing, or too much load at a time. May cause the target server resources to run out, serious even causes the panic.
One: Installation
Download: http://httpd.apache.org/download.cgi
Select Files for Microsoft Windows
Can be directly selected Apachehaus
Unzip the file into the local folder, if it is not unpacked in the C drive, you need to set the parameters:
I extracted to the D disk, need to set parameters, conf->httpd.conf using a text editor to open,
There are three places that need to be modified:
A:
Run the root directory and modify the path to the local decompression
B:
Listening port, the default listening port is 80, if it has been used will be an error to modify, if the 80 port is not used, can not be modified, if the listening port is modified, you need to change the servername localhost to the same port number
C:
DocumentRoot test file is stored, and the directory must exist
After the configuration is complete, go to the D:apache24/bin directory, press SHIFT and right-click, choose here to open the command window
Run Httpd.exe-k Install
* How to start and close?
The first use of services.msc, find apache2.4, you can click on the left to restart, close; the second can be started with a command: Httpd.exe-k start
Two: Test
Ab-n 2000-c Http://*:8000/recommend?companycode=param
-N: Number of requests
-C: Concurrency number
Param:post you need to pass the parameters
*: IS IP address
Windows Apache AB Installation and stress testing