Jmeter distributed testing master as 2 clients - jmeter

i want to perform distributed testing on a couple of slaves machines with different purposes and use the same master for that.
the problem is that it's not working good together. for example: i have 3 slaves who are responsible to execute test plan X and i have 3 slaves who are responsible to execute test Y.
when i invoke just test X or just test Y the master and the slaves works fine, but when i try to invoke test X and then test Y the later get close immediately.
i guess that it's because the rmi port is used by the previous test.
is there any when to configure the properties file so i can execute both test X and test Y?

You cannot run more than one test at a time on a given slave.
If your slave machines are powerful enough you can launch 2 different slaves processes on different ports like:
Start slave process #1 on port 1111:
jmeter -Jserver.rmi.port=1111 -Djava.rmi.server.hostname=10.20.30.40 -s
Start slave process #2 on port 2222:
jmeter -Jserver.rmi.port=2222 -Djava.rmi.server.hostname=10.20.30.40 -s
Now you can specify on master on which slave you want to execute the current test like:
jmeter -Jremote_hosts=10.20.30.40:1111 -r -n -t test1.jmx will start test1 on first slave instance
jmeter -Jremote_hosts=10.20.30.40:2222 -r -n -t test2.jmx will start test2 on second slave instance
and these may go in parallel
More information:
Remote hosts and RMI configuration
How to Perform Distributed Testing in JMeter
Overriding Properties Via The Command Line

Related

How to handle JMeter Master slave issue

I am using below shell script to execute JMeter from master machine and post execution of Jmeter i am triggering JMeterPluginsCMD.sh to generate jtl to csv file
for filepath in /tmp/scripts/*.jmx; do
filename=$(echo "$filepath" | sed -r "s/.+\/(.+)\..+/\1/")
echo "Running testplan ${filepath}"
resultpath="/tmp/results/testresult.jtl"
logpath="/tmp/results/log/testlog.log"
jmeter -n -t "$filepath" -l "$resultpath" -R"$SLAVE_IP_ADDRESSES" -
Jserver.rmi.ssl.disable=true -j "$logpath"
done
sleep 600
JMeterPluginsCMD.sh --generate-csv "/tmp/results/test.csv" --input-jtl
"/tmp/results/testresult.jtl" --plugin-type AggregateReport
sleep 600
Above code works fine with limited user load, but under high load when master does not receive below acknowledgment from slave.
021-05-18 06:37:02,457 INFO o.a.j.JMeter: Finished remote host: 10.1.1.1
It does not trigger JMeterPluginsCMD.sh.
What are the possible reasons of not receiving this acknowledgment. Is there any way to by pass the communication issue(JMeter Master->slave) and execute
JMeterPluginsCMD.sh with out any fail
If you "by pass the communication issue(JMeter Master->slave)" you won't get any results therefore it will be no sense in running your "JMeterPluginsCMD.sh".
So I would rather suggest
looking into the jmeter.log file on the slave machine and perhaps on the master machine as well, there is a chance you will be able to figure out what's wrong from the log
ensure that both have enough headroom to operate in terms of CPU, RAM, Network, Disk, etc. see 20 Command Line Tools to Monitor Linux Performance or just go for JMeter PerfMon Plugin
make sure to follow JMeter Best Practices
If your current slave machine is not powerful enough in order to conduct the "high load" you might need to add another slave and divide your "high load" by half.

Jmeter - How to execute tear down thread group only after shut down of main threads in all the slaves?

I am using Jmeter 5.1 and Windows 10.
In my test plan I have main thread and tear down thread and I am running this across two Jmeter slaves, In my test plan I have selected execute the teardown threads only after shutdown of main thread group, it works but it only works to that slave, it doesn't look for other slaves was it still running the main threads or not?.
Could you please tell me a way, I need to execute the tear down thread group only after shutting down of all the main thread groups in all the slaves.
Please help.
Thanks,
Rafiq
This happens as slaves are confined to the JVM where it runs. A copy of test plan is shared with the salves (servers) and they are executed independently and send test result to the client.
You may create a token MAIN_TEST_COMPLETED in a share file accessible by the slaves and check the status of the token before executing the TearDown Thread Group. While controller can be used to wait till the main threads are completed.
Hope this is useful for your requirement.
I used another way, I created one more script and added the first script and second script execution through command prompt so that when the first script is done than the second command will be executed and it executes the test script which is the tear down part.
For Example, I created a bat script like the one specified below and that solves the problem
jmeter -n -t mainscript.jmx -l result.jtl -r
jmeter -n -t teardownplan.jmx -l teardownresult.jtl -r

JMeter slaves are not reading property file values

I am running jmeter distributed test. I have lot of combinations to test, so created property files (.properties) to execute different tests.
For example:
I have 1 master and 2 slave machines. I have kept jmx script in master machine and test data in all slaves
Started jmeter-server in all slave machines
Ran distributed test from master with following command
"jmeter -n -t script.jmx -p condition1.properties -R SlaveIP1,SlaveIP1 -l results.jtl"
Results:
Test runs well but with default values defined in script. In my case test duration defined in script is 300 secs whereas test duration in condition1.properties file is defined as 900, but test always runs for 300 seconds.
This is just an example, I have many other parameters defined in property file and should be picked up while running the test.
This problem is happening only in case of master & slave condition, otherwise running test from single machine picks up all values defined in property file.
According JMeter list of command-line options you can't use -p in the case of disturbed testing, but use -G instead.
-G, --globalproperty <argument>=<value>
Define Global properties (sent to servers)
e.g. -Gport=123
or -Gglobal.properties

Jmeter run 2 test plans sequentially command line

I have 2 test plans for 2 different processes that I want to test using Jmeter; both scripts are implemented and can be run individually via the Jmeter GUI.
However, is it possible to run one test plan using the command line, and then once the first test plan finishes, the second test plan gets kicked off. Basically, I want to run one test plan after another: NOT at the same time...
Eventually we want to put these 2 test plans on a server and have them run one after the other using some maven script, but for now is there any way to accomplish this using Jmeter's command line?
For the command-line non-GUI mode just run your files using shell script like:
jmeter -n -t test1.jmx -l result1.jtl
jmeter -n -t test2.jmx -l result2.jtl
You can also pass the same file via -l command-line option, results of test2.jmx will be appended to the results of test1.jmx.
For Maven execution just copy both .jmx scripts to src/test/jmeter folder of your project - Maven will execute the tests sequentially.
After test execution you will be able to find results files under target/jmeter/results folder, one file per .jmx script. The results can be merged together via i.e. Merge Results tool
More information:
JMeter Maven Plugin
Five Ways To Launch a JMeter Test without Using the JMeter GUI

insert delay in jmeter in capturing results

I have a jmeter script which does a remote ssh and executes a R script now I need the jmeter to delay wherein it starts capturing results in the listeners after say 6 seconds how can I achieve that.
I don't think you'll be able to do it using JMeter Test Elements however you can insert a delay on SSH command level using sleep command like:
./your_R_Script && sleep 6
See How to Run External Commands and Programs Locally and Remotely from JMeter for more tips and tricks on how to kick off remote processes from JMeter

Resources