Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What to do when it cannot be hosted locally in JMeter?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "what to do when the local cannot be carried in JMeter". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

For large concurrency requirements, such as tens of thousands of concurrency, due to the limitations of CPU and memory, stand-alone simulation scenario can not be realized. In order to enable JMeter to provide greater load capacity, it is necessary to use its distributed mechanism, that is, the function of multiple machines generating load at the same time.

Features:

1. Real performance testing, there is no network bottleneck problem

2.GUI is limited to windows platform. Command line is available on linux and windows.

3. The test results are saved on a local master.

4. Use this master to manage multiple Jmeter Engines, also known as slave

5. The test script is automatically sent by master to slave as a load generator, but the data file does not

When testing a distributed platform, it is best to pay attention to the following:

1.master can also be used as slave at the same time, but pay attention to the right amount of load

two。 Install the same jmeter and jdk on all load generators slave

3. Firewalls and antivirus software should be turned off or filtered

4. Ensure that all master and slave are on the same segment or subnet with no network latency

5.master and slave can be windows or linux, not all the same OS, but open the firewall, otherwise connect fail

6. The data files (such as CSV) used by the script need to be transferred to each slave separately, and the file path specified in the script should be able to find the file in each slave. The relative path is often used, which is more convenient.

7. Make sure jmeter can access the server

8. Make sure that each version of jmeter is consistent, and there may be coordination problems among different versions.

First, the principle of Jmeter distributed execution:

1. In Jmeter distributed testing, one of them is selected as the dispatching machine (master) and the other machine as the slave.

2. When executing, master will send the script to each slave. After slave gets the script, it starts execution. When slave executes, it does not need to start GUI. I understand that it should be executed through command line mode.

3. After the execution is completed, slave will send the result back to master,master and collect all the slave information and summarize it.

1. Slave configuration:

1. Jmeter and JDK that support the current Jmeter version need to be installed on the slave machine. (sometimes you will be prompted that the JDK version is too low when running Jmeter)

2. Add environment variables: the JMETER_HOME path is the directory one level above the bin directory, so when you start the jmeter-server service, you will only see Found ApacheJMeter_core.jar.

3. Start: jmeter-server.bat in the bin directory, and the successful startup is as shown below. Do not include spaces in the installation path of jmeter, because jmeter-server.bat does not support folder paths with spaces. )

4. The IP and port marked in red in the above figure will be used when configuring in master. IP is the IP of the slave machine. The port is 1099 by default, and the port can also be customized. Here I customize it to 1000.

5. If you have more than one slave, just repeat steps 1-4.

3. Dispatcher (master) configuration:

1. Script: a simple script to visit Baidu:

2. Open the jmeter.properties file in the bin directory of Jmeter, and modify the following configuration: IP and Port are the IP of slaver machine and the default port 1099. The following two configuration methods are available.

Remote_hosts=172.16.xx.xx, http://172.16.xx.xxx

Remote_hosts=172.16.xx.xx:1099, http://172.16.xx.xxx:1099

Multiple slave were separated by "," before.

Modify the following configuration, where I customize the port to 100:

Remote_hosts=10.13.223.202:1000,10.13.225.12:1000

I have configured 2 sets, and you can see that the red one is the IP and Port of the screenshot slave above.

3. Open Jmeter and select run. There are two options: run start and run all start:

4. Select remote startup-- > 10.13.225.12 purl 1000

A) master result, here I only started the slave of 10.13.225.12 slave 1000, so there is only one result (the number of threads and the number of loops are 1):

B) slave console information:

5. Select remote start-> remote start all:

A) master results, all started, I configured 2 slave, so there are two execution results:

4. Custom port:

How to customize the slave port:

1. Slave: find the jmeter.properties file in the bin directory of the Jmeter of the slave machine, and modify the following two configuration items, for example, I modify it to 9999:

Server_port=9999

Server.rmi.localport=9999

2. The jmeter-server.bat port on the slave machine has been modified to: 9999

3. Master: modify the jmeter.properties file of the master machine:

Remote_hosts

4. Restart jmeter.bat

5. Other instructions:

1. The dispatching machine (master) and the execution machine (slave) should be separated. Because master needs to send information to slave and will receive test data sent back by slave, mater itself will consume, so it is recommended to use a separate machine as mater.

2. Parameter file: if you use csv for parameterization, you need to copy the parameter file on each slave and set the path to the same. Set it here for Filename.

3. The Jmeter version and plug-ins installed on each machine had better be the same, otherwise there will be some unexpected problems.

4. If you want master to share the load and let master execute the test plan itself, you need to write the IP and port of master into the configuration file, and run the jmeter-server.bat of master before remote startup, so that master can execute the test plan with other slave.

VI. Comparison

Similarities and differences with LoadRunner:

1. All can realize distributed load, each has its own advantages and disadvantages.

two。 Both slave under windows and linux are supported, but master,jmeter is cross-platform, LR is not

3.LR can specify that each slave generates a different number of concurrent users, but jmeter cannot

The data files used by the test plan in 4.jmeter are not sent to slave with the script, while LR can be sent to the remote slave by choosing to be managed by LR.

This is the end of the content of "what to do if you can't hold it locally in JMeter". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report