15 jmeter distributed performance test

Background
Due to the bottleneck of jmeter itself, when thousands of concurrent users need to be simulated, it is not enough to use a single machine to simulate all the concurrent users, and even cause a Java memory overflow error. To solve this problem, you can use distributed testing, run multiple machines and use the so-called Agent to share the pressure of jmeter itself, and use this to obtain a larger number of concurrent users, but some related modifications are required.
To sum up, jmeter is developed by java and consumes memory and cpu, so it still needs to be distributed under large concurrency.

测试步骤
1.关闭防火墙。
2.在所要运行jmeter并作为负载生成器的机器上安装jmeter,并确定其中一台机器作为Controller,其他机器作为Agent。然后运行所有Agent机器上的jmeter-server.bat文件。假定我们使用两台机器192.168.0.11和192.168.0.12作为Agent(Agent机器上必须安装JDK,并设置环境变量)。
3.在Controller机器上的%JMeter_home%/bin目录下,编辑jmeter.properties中“remote_hosts=127.0.0.1”。其中的127.0.0.1表示运行jmeter Agent的机器,这里需要修改为“remote_hosts=192.168.0.11:1099,192.168.0.12:1099”,其中的1099为端口号。
4.启动controller机器上的jmeter.bat,选择菜单Run中“远程启动”中的192.168.0.11:1099或192.168.0.12:1099来分别运行Agent。如果两个都要执行,可以点击Run菜单下的“远程全部启动”。
5.有时候用作代理的机器太少,仍不能满足需要,则需要将作为Controller的电脑也当做Agent,则同样需要修改jmeter.properties文件,将Controller的IP写入。同时,这个时候需要先打开Controller电脑中%JMeter_home%/bin目录下的jmeter-server.bat,然后再打开jmeter.bat。此时,进入Run下的“远程启动”菜单,可以看到Controller也作为远程机器进行运行。

FAQ
1. Make sure that the jdk version installed on the controller machine is the same as jmeter.
2. When the Agent machine starts jmeter-server.bat, the background prompts: "Could not find ApacheJmete_core.jar".
Solution: This is that ApacheJmete_core.jar was not found at the beginning. If you don't want to see the words Could not find, you need to add the environment variable JMETER_HOME, and the path is the upper-level directory of the bin directory, so that when the jmeter-server service is started, it will not be See "Could not find ApacheJmete_core.jar".
3. During the distributed control process of jmeter, the number of threads started by each Agent is equal to the configuration in the thread group.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325900516&siteId=291194637