In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Distributed meaning: when using Jmeter for performance testing, if the number of concurrency is relatively large (for example, the recent project needs to support 1000 concurrency), the configuration of a single computer (CPU and memory) may not be supported, so you can use the distributed testing function provided by Jmeter.
1. Jmeter distributed execution principle when Jmeter distributed testing, one of them is selected as the master/Controller, and when the other machines are executed as the slave/Agent, the master will send the script to each slave, and the slave will start execution after getting the script. When slave executes, there is no need to start GUI. I understand that after the execution is completed through the command line mode, slave will send the result back to master. Master collects all slave information and summarizes the principles of distributed testing: as shown in the following figure
Second, slave configuration Jmeter needs to be installed on the server, use the rz command to upload the jmeter compressed file, and then decompress it
If the default user is not an administrator, you can modify the user environment variable: vi ~ / .bashrc, add the line export PATH=$PATH:/home/mdrsopen/apache-jmeter-4.0-performance/bin at the end of the file, and this path is the path of jmeter. After modification, enter: wq exit, execute source ~ / .bashrc
Enter jmeter-v, and the following figure proves that the configuration is successful
Enter the bin directory of jmeter, modify the jmeter-server file, and specify the host ip
Remove the # in front of the RMI_HOST_DEF, and change the XX at the end to the current host ip, which can modify the loader port. The default is 1099, or you can modify it to the port you need. After modification, enter: wq exit input. / jmeter-server start the loader. The following interface appears, which proves that multiple slave has been started successfully. Repeat step 1: 5 if the parameter file is called in the script, or other uploads of pictures appear. All the files need to be placed in the bin directory of the slave node. Since the relative path format is.. / data/id.xls this time, you only need to manually create a data folder one level above the bin directory, and then put the parameter file under the file.
3. Dispatch machine (master) configuration script: a query API of devops platform finds the jmeter.properties file under the bin directory of Jmeter, and modifies the configuration as follows. IP and Port are IP and custom ports of slave machines (loader port has a custom value of 1234 and a default value of 1099): remote_hosts=10.16.69.174:1234,10.16.18.21:1099 uses "," before multiple slave, and I have configured two. You can see that the red one is the IP and Port of the screenshot slave above. Open Jmeter and select run. There are three options: startup, remote startup, and remote full startup:
Start: start the current master (dispatcher), and execute the dispatcher as a loader separately.
Remote boot: you can choose to execute the required loader
Remote full boot: as the name implies, it starts all loaders and chooses remote boot-> 10.16.18.21:1099master result. Here I only start the 10.16.18.21 slave 1099, so there is only one result (the number of threads and cycles are 1): slave console information:
Select remote start-> remote start all: master results, all started, I configured 2 slave, so there are two execution results. 4. Dispatcher (master) uses commands to execute distributed test widows environment execution jmeter-n-t listening settings. JMX-r-l log.jtl parameters description:
-n tells jmeter to execute the test in non-GUI mode
-the name of the test script executed by t
-r remote execution, all remote servers specified in the Jmter.properties file
-l result file, if the path is not written, the linux environment command is generated in the execution directory. 5. Other instructions: it is best to separate the dispatcher (master) and the executor (slave). 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. You'd better have the same Jmeter version and plug-ins installed on each machine, or something unexpected will happen. To ensure that the port set by the executor (slave) is not occupied, you can use this command to query. Netstat-anp | grep port can be configured if the query is empty, as follows
If the query has a value, it means that the port is already occupied. The server service that needs to start the slave machine with another port reports the following error. It depends on whether server.rmi.ssl.disable=true is enabled in the jmeter.properties file under apache-jmeter-4.0\ bin. The error is as follows.
Default is
Need to be changed to
Start master. If java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory) is also reported, the modification method is the same. You need to check whether server.rmi.ssl.disable=true is enabled in the jmeter.properties file. The error is as follows
The master execution log shows that the number of execution requests is 0
Check the jmeter-server.log log. The log path is the path where the slave node is started by executing the jmeter-serer command, as shown in the following figure. The startup path is under / apps.
From the figure above, we can see that the error is caused by the fact that the CSV element cannot find the relative path. Since the path of the slave startup node is / apps, you need to place the data parameter file on a level on / apps. You can start the slave node directly under the jmeter/bin directory, so that the relative parameter file is at a level in the bin directory. For more information, please see (2. Introduction to slave configuration)
if the article is helpful to you, you can click on the follow function in the lower right corner. Welcome to forward and clap the brick. I will continue to launch articles related to the test and share the testing technology with you. Every original article is written attentively to put an end to plagiarism and copying. The official Wechat account is synchronized with the articles on this platform for easy reference.
QQ technology exchange group: please enter the verification information 51CTO to add the group.
Wechat QR code follow official account:
After following, reply to the resource download, and you can get the download address of all kinds of resources shared by yourself.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.