ab pressure test overview
Apache comes with a stress test tool ab, which is simple and easy to use, and can simulate various conditions to initiate test requests to the web server. The
ab tool can directly initiate test requests locally on the web server. This is essential for understanding the processing performance of the server. It does not include the network transmission time of the data and the local calculation time of the user's PC, so that the performance of the Web server can be judged by observing various time indicators for optimization and adjustment of parameters
Command format
ab parameter URL
Common parameters
-n the total number of requests executed in the test session, by default only one request is executed
-c the number of concurrent requests, by default one at a time
-t the minimum number of seconds for the test
-v to set the level of detail of the displayed information
bring it on! Show!
Install HTTP, install DNS
domain name www.charis.com
The apache compression module
is not turned on. Perform three stress tests.
Observe the total time and take the average.
[root@5centos html]# ab -n 2000 -c 1000 www.charis.com/index.html
First time 26.092
Second time 25.282
Third time Times 21.047
Open apache compression function
[root@localhost htdocs]# vim /etc/httpd.conf
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml text/javascrip text/jpg text/png
DeflateCompressionLevel 9
SetOutputFilter DEFLATE
</IfModule>
[root@localhost htdocs]# service httpd stop
[root@localhost htdocs]# service httpd start
First time 20.179
Second time 0.267
Third time 0.504
Sit down! ! !