Use ab for stress testing under linux

 First, determine the tools for stress testing and performance monitoring tools. The stress testing tool uses ab, and the monitoring tool uses nmon.
   

Install:    

yum install httpd-tools

 

     Look at the data of ulimit -n on the linux host. Since the changed one is 1024, it is better to change it a little bigger. This is the maximum number of threads under linux. If it is too small, a large number of parallel tests cannot be performed.


  The script I use for ab stress test is as follows:

  1. (get method)

./ab -n 1000 -c 1000 -k http://xxx.xxxxx.com/synth/open/recurls.do?test=true

 
  2. (The post method is json data in postfile.ab)

./ab -n 2500 -c 2500 -k -p postfile.ab http://xxx.xxxx.com/synth/open/getTheme.do


  The parameter n is the number of requests, c is the number of concurrent requests for one request, and -k is keep_alive. Generally, it is better to bring the -k parameter when there is an error that the link is reset.

  There are also many parameters, which can be seen in ab--help (this is a super cheat).

  The meaning of each item of the result is not much to say, search a bunch on baidu google.

  Leadtest believes that at the same time as each stress test, nmon can be turned on for real-time monitoring, and the recording function of nmon can be turned on to record data.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326946184&siteId=291194637