This article has participated in the activity of “New person creation Ceremony”, and started the road of digging gold creation together.

In the pressure test, a common problem is that the performance of the pressure measuring machine itself is not good, can not provide pressure to meet the requirements, can not reach the performance bottleneck, so as to meet the purpose of the test. When the performance of a single press is insufficient but other presses are available (there are multiple virtual machines, but the performance of each machine is not strong enough), the distributed deployment mode of 1 master, multi-slave can be used to make full use of the performance of multiple servers and provide enough concurrent pressure to meet the requirements of the test. Using this approach, the author achieved 3W concurrent requests with a pressure cluster of 15 servers.

Distributed deployment: One master terminal and multiple controlled terminals. It mainly configures the controlled end. Both must be deployed on Linux. Currently, when Windows is used as the main control terminal to access The Linux controlled terminal, the access is blocked.

The controlled end needs to start jmeter-Server first, and the main control end accesses the jmeter-Server through RMI.

Ensure that the main control terminal can access the IP address of the controlled terminal

If there are additional plug-ins or data sources (such as CSV, etc.), both the master side and the controlled side need to be added


Optimization of Linux system parameters. The default maximum number of connections in Linux is 1024. During the pressure test, exceptions often occur due to insufficient connections. You need to adjust system parameters before performing the test.

vi /etc/sysctl.conf

vm.max_map_count=655360

vm.swappiness=1



fs.file-max=655356000

fs.nr_open=104857600



net.ipv4.tcp_fin_timeout = 30

net.ipv4.tcp_keepalive_time = 1200

net.ipv4.tcp_syncookies = 1

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_tw_recycle = 1

net.ipv4.ip_local_port_range = 1024 65000

net.ipv4.tcp_max_syn_backlog = 8192

net.ipv4.tcp_max_tw_buckets = 5000

Run the following command to make the modification take effect

 /sbin/sysctl -p


vi /etc/security/limits.conf

root    soft    nofile    1048576

root    hard    nofile    67108864

root    soft    nproc     102400

root    hard    nproc     655360

*       soft    memlock   unlimited

*       hard    memlock   unlimited

Note: vi editor, press I to enter editing mode. Shift + insert paste, press Esc to exit editing mode, enter :wq to save the configuration and exit

Master the Linux

  1. Disable =true in {dir}/bin/jmeter.properties server.rmi.ssl.disable=true in {dir}/bin/jmeter.properties At this point, the controlled end and the main control end must be consistent
  2. The edited script generates JMX
  3. After starting Jmeter -r on the command line, write the IP address and port number of the controlled end. Multiple controlled ends are used and separated. -l Stores the result. -e -o Outputs the HTML address
  4. Note that the script must set the duration or number of cycles. After the specified duration or number of cycles is reached, the report automatically stops and starts to be generated. If the Settings are incorrect, the test cannot be aborted and can only be closed manually. Manual closing cannot generate reports

Start the command./jmeter -n -t.. / test2. JMX -r 192.168.0.140:8123192168 0.156:8123 – l.. /results/5.jtl -e -o .. /results/html5

Charged with Linux

  1. Disable =true in {dir}/bin/jmeter.properties server.rmi.ssl.disable=true in {dir}/bin/jmeter.properties
  2. To change the listening IP address, run the ifconfig command to view the local IP address. Modify {dir} / bin/jmeter – RMI_HOST_DEF = – Djava. Within the server. The rmi server hostname = {} IP note the # comments are removed. As RMI_HOST_DEF = – Djava. Rmi. Server hostname = 192.168.1.181
  3. {dir}/bin/jmeter-server SERVER_PORT:-1099
  4. After the change number is configured, start the Jmeter-server and wait for the command from the main control

Finally, sort out the steps

  1. Use jMeter visual interface to write stress test scripts, and debugging is completed
  2. Deploy jMeter on the controlled and master side and modify the configuration
  3. Place the written JMX script on the master side
  4. When the test is started on the master terminal, you can specify the number of cycles and execution time through command line parameters, and specify a representative HTML folder name for subsequent access
  5. Wait for the test to complete and generate the test report HTML file
  6. Open HTML /index.html to view the test report. It is recommended to use nginx to start auto_index

Matters needing attention

  1. If too many tests are performed, the master end will be very slow to generate reports and may run out of memory. You need to increase the memory configuration of the Java VIRTUAL machine used by JMeter. You must wait for the test program to complete itself, otherwise the test report will not be accessible
  2. If the number of concurrent connections is very large, network bottleneck is first caused. Network connection parameters must be modified to meet the requirements of the number of connections. Otherwise, the concurrent pressure is blocked at the network layer and the service server cannot be connected, and the test purpose cannot be achieved