Home >Backend Development >PHP Tutorial >PHP uses ab in Apache to test the stress performance of the website_PHP tutorial
Open the installation path of the Apache server (I use WampServer). There is an executable program ab.exe in the bin directory, which is the stress testing tool to be introduced.
In the command line of Windows system, enter the directory where the ab.exe program is located and execute the ab.exe program. Note that double-clicking directly will not work correctly. 喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+ICAgICAgICBkOii72LO1L734yOtExcwpPGJyPgo8L3A+CjxwPiA8aW1nIHNyYz0="http://www.2cto.com/uploadfile/Collfiles/20140614/20140614091704240.jpg" alt="">
cd wampbinapacheApache2.4.4bin (Enter/enter the bin directory)
ab(Enter/)
If you see the following help information, it means ab has been successfully started
Start ab stress test
Ab -n 5000 -c 200 http://localhost/test.php
The above example indicates that the script http://localhost/test.php has been accessed 5,000 times in total, with 200 concurrency (simulating simultaneous access by 200 users).
Introduction to commonly used ab parameters:
-n: The total number of request executions, the default is 1;
-c: Number of concurrencies, the default is 1;
-t: The total time of the test, in seconds, the default is 50000s
-p: Data file during POST
-w: Output the results in HTML table format