Jmeter (44) - From entry to advanced level - Jmeter remote startup (local run + remote run) (detailed tutorial)

1 Introduction

This article is actually very simple, just to pave the way for the next article, so give it to your friends or children to warm up in advance.

2. What is remote operation?

Remote execution means that the script is placed locally and executed on another computer. Of course, it can be executed on multiple computers remotely. The most common scenario is that when running a performance test, if one computer cannot load the required threads, two or more computers are needed to start the threads to run the test. The threads are equivalent to virtual users. On the Internet, it is usually said that when there are more than 1,000 threads, do not use one computer to run, but choose to use multiple computers to load together. This statement is not entirely correct. For example, if the script writes an insert statement, inserts data into the database, and starts 20 threads to run, it is estimated that your computer's CPU usage will be 100%. Therefore, in the end, it still depends on whether the computer can withstand it, rather than how many threads there are. Different test scripts will put different pressure on the test machine. Many times, when doing performance testing, waiting time is added in order to simulate real user operations. For example, in the user login function, when the user enters the user name and password, the server is waiting, so the script will add a waiting time here.

If you want to learn automated testing, I recommend a set of videos to you. This video can be said to be the number one automated testing tutorial on the entire network played by Bilibili. The number of people online at the same time has reached 1,000, and there are also notes that can be collected and communicated with various channels. Master technical communication: 798478386    

[Updated] A complete collection of the most detailed practical tutorials on Python interface automation testing taught by Bilibili (the latest practical version)_bilibili_bilibili [Updated] A complete collection of the most detailed practical tutorials on Python interface automated testing taught by Bilibili (practical version) The latest version) has a total of 200 videos, including: 1. Why interface automation should be done for interface automation, 2. Overall view of request for interface automation, 3. Interface practice for interface automation, etc. For more exciting videos from UP master, please follow the UP account . icon-default.png?t=N7T8https://www.bilibili.com/video/BV17p4y1B77x/?spm_id_from=333.337

3. Why run remotely?

Jmeter is a Java application that consumes a lot of CPU and memory. Therefore, when thousands of concurrent users need to be simulated, it is somewhat inadequate to use a single machine to simulate all concurrent users, and may even cause JAVA memory overflow errors. In fact, Jmeter's remote startup can help us solve this problem by controlling multiple remote jmeter servers through a single jmeter client so that they can simultaneously stress test the server.

4. Environment

The local environment is as follows:

Jmeter version: 5.1.1, as shown in the figure below:

System: Windows 10 version 64-bit system (32-bit students will find their own solution), as shown in the figure below:

 

The remote environment is as follows:

Jmeter version: 5.1.1, as shown in the figure below:

System: Windows 10 version 64-bit system (32-bit students will find their own solution), as shown in the figure below:

 

5.Install jmeter

Install jmeter on the local and remote machines respectively. Brother Hong will not introduce it in detail here. Students who don’t know can refer to this installation article by Brother Hong: https://www.cnblogs.com/du-hong/p/ 12894560.html.

6.Configuration

Local machine: Under the bin of the Jmeter installation path, edit the jmeter.properties file and add the following content:

# Jmeter remote start: Controller machine configuration, the format is: "IP1:port1, IP2:port2", only one Agent is configured as follows;

remote_hosts=*.*.*.95:1029    

Remote machine: Under the bin of the Jmeter installation path, edit the jmeter.properties file and add the following content:

# Jmeter remote start: Agent machine configuration

server_port=1029

server.rmi.localport=1029

Note: If the port is occupied, enter "netstat -ano" in the dos box on Windows to check the port usage. It is recommended to use a new port here;

7.Script files

For demonstration, I simply recorded a script file to access Du Niang, as shown in the figure below:

8. Start

① Local machine: "Run" → "Remote Start", you can see the IP and port of the remote machine configured by Hongge, as shown below, select this machine;

 

②Remote machine:

Jmeter is installed on the Windows platform: cmd to dos, enter the bin directory of the Jmeter installation path, and execute "jmeter-server"

③View the local result tree, as shown below:

 ④ Check the remote cmd in dos, enter the bin directory of the Jmeter installation path, and execute the "jmeter-server" window, as shown in the figure below:

At this point, the remote startup execution is completed.

9. Summary

1. Jmeter is installed on the Linux platform: enter the bin directory of the Jmeter installation path and execute "./jmeter-server";

Otherwise, the following error will be reported: "Java.net.ConnectionException: Connection refused:connect"

 

2. Similarly, if Jmeter is installed on the Linux platform: enter the bin directory of the Jmeter installation path and execute "./jmeter-server";

Otherwise, the following error will be reported: "Java.net.ConnectionException: Connection refused:connect"

3. Jmeter5.2.1, error reporting when startingjava.io.FileNotFoundException: rmi_keystore.jks 

  • Solution 1: jmeter.propertiesSet up the slave server.rmi.ssl.disable=true
    . Reason: For versions above jmeter 4.0, secure communication of RMI connections is enabled by default, and a keystore needs to be created. So just disable SSL.

  • Solution 2: Manually generate the key and certificate. Execute create-rmi-keystore.bat(for Windows) or create-rmi-keystore.sh(for Linux)

 

Guess you like

Origin blog.csdn.net/Faith_Lzt/article/details/132945621