Web site Performance Stress testing is an essential part of the performance tuning process of the server website, only to let the server in the case of high pressure, can really reflect the software, hardware and other improper settings exposed problems.
Performance testing tools are now most commonly found in the following categories: AB, Http_load, Webbench, siege. AB is an Apache-brought stress test tool that is useful for simulating multi-threaded concurrent requests and testing server load pressures. It can not only perform site access stress tests on Apache servers, but also stress test other types of servers. AB is very low on the computer that emits the load, does not consume a lot of CPU, and does not consume too much memory, but it can cause a huge load on the target server.
In the case of insufficient bandwidth, the final test is this machine, it is recommended to use the intranet of another or more servers through the intranet test, so that the data obtained, the accuracy will be much higher. Remote Web server stress testing, often ineffective, because the network delay too large or insufficient bandwidth, the results are not accurate.
In the performance optimization adjustment process, pre-test AB for pressure testing before optimization, then the pressure test, compare two test results, see whether the optimization effect is obvious, and then decide whether to enable the optimization scheme.
Manually compiled and installed Apache service is not duplicated, specific installation can refer to the previous Apache Web page optimization of the operation, which slightly different is the installation of the module, as well as the main configuration file changes.
1. The installed module has CD HTTPD-2.4.2/
./configure \
--PREFIX=/USR/LOCAL/HTTPD \
--enable-deflate \//Support Web page
--ENABLE-SO \
--enable-rewrite \//Support rewrite
--enable-cgi
2. The modules to be opened in the main configuration file are:
LoadModule deflate_module modules/mod_deflate.so//Compression module
LoadModule headers_module modules/mod_headers.so//Head authentication module
LoadModule filter_module modules/mod_filter.so//filter module
3. Add (module compression) at the end of the Apache master profile and put a JPG image on the Web page to test it
<ifmodule mod_deflate.c>
Addoutputfilterbytype DEFLATE text/html text/plain text/css text/xml
Text/javascript text/jpg Text/png
Deflatecompressionlevel 9
Setoutputfilter DEFLATE
</IfModule>
4.ab pressure test Tool location, use the which command to find
5.ab Command Parameter table
-N: The total number of requests executed in the test reply, by default only one request is executed
-C: Number of concurrent requests, one at a time by default
-T: The number of seconds to test
-V: Displays the level of detail of the information
6. Test with the AB tool
Test the pressure test of the open compression module first
7. Close the compression module in the Master profile and perform the same command, comparing it with the results above
The test result is slightly different from the previous one, in the actual environment, depending on the number of requests and so on, the configuration parameters are adjusted frequently, so that Apache can maximize the performance of optimization.
Apache depth Optimized AB pressure test