How to handle JMeter Master slave issue - jmeter

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.

Related

JMeter - Reading a Custom Property file in Non-GUI mode

I have a custom property file, which is read via
jmeter -q C:/Users/503289283/Downloads/eml_base.properties -t Service_Names.jmx
Same thing when executed in Non-GUI mode i.e.
jmeter -q C:/Users/503289283/Downloads/eml_base.properties -n -t Service_Names.jmx
Throws an undesirable message at the end of run
Script is running for a longer duration than it should. Output received is perfect.
Solving this could reduce the Test duration (Non-GUI mode).
Thanks for your support.
Regards,
Ajith
The "undesired" message you're getting is from jsch library which is reading some stream hence JMeter cannot gracefully terminate its threads because SSH connection is open.
So you need to take a look at what is being done on SSH/SFTP level.
I also fail to see any results in the output which means that no samplers have been successfully executed at all, check out jmeter.log file for any suspicious entries. You may also want to increase JMeter logging verbosity for the jsch library by adding the next line to log4j2.xml file:
<Logger name="com.jcraft.jsch" level="debug" />

Jmeter distributed testing master as 2 clients

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

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

Quit Jmeter after tests and save aggregate reports

Yesterday due to some reason my Jmeter Machine crashed and I do not have results.
These results run overnight on a laptop, what I am looking for is, I can quit Jmeter ones tests are done and my reports get saved automatically.
Given you run JMeter in command-line non-GUI mode like:
jmeter -n -t /your/script.jmx -l /test/results.jtl
JMeter should store test execution results in the results.jtl file. When the test is finished you will be able to open the file with the Listener of your choice using "Browse" button and analyze the results.
Even in that case you can loose some data in case of JVM crash, by default JMeter doesn't store each single result, it periodically flushes results data. You can add the next line to user.properties file in order to tell JMeter to store each single result immediately (JMeter restart will be required to pick the property up):
jmeter.save.saveservice.autoflush=true
Alternative way is passing the property via -J command-line argument like:
jmeter -Jjmeter.save.saveservice.autoflush=true -n -t /your/script.jmx -l /test/results.jtl
See Listeners > Default Configuration to learn more about JMeter defaults, what properties are available and what can be changed to make results to look accordingly to your requirements
Run the JMeter always in Non-GUI mode.
Following is the command:
jmeter.bat -n -t Sctipt.jmx -l results.jtl
-l : option to save the results.
When the test is completed, automatically results will be saved in results.jtl file. you can give full path also, otherwise, saves the file in current directory i.e., JMeter folder where 'jmeter.bat' file present.
Don't keep any listeners in the script as they utilizes system resources.

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