Jmeter Execution on Remote system does not work - jmeter

I am able to successfully execute JMX file on local instance but execution on Remote system(Slaves) fails. I am using latest version of Jmeter. This is the second time I am facing the issue.
Can you please advise if I am missing anything here. I initially thought it was because I had toggled off the script from Execution but thats not the case here.
My script(JMX) has a Transaction controller(under a Thread group) with some http requests.
Code from command line executed is as below. Its the same result when I execute from Run>>Remote Start
sh Jmeter.sh -n -t R3Performance_Fragment.jmx -R 192.168.7.25 -G ucount=1 -l Results/r1.csv
Results are as below. It just starts and winds up without initiating the Execution at all.
Krishna-MBP:bin krishnap$ sh Jmeter.sh -n -t
R3Performance_Fragment.jmx -R 192.168.7.25 -G ucount=1 -l
Results/r1.csv Creating summariser Created the tree
successfully using R3Performance_Fragment.jmx Configuring remote
engine: 192.168.7.25 Starting remote engines Starting the test # Mon
May 29 13:07:40 IST 2017 (1496043460922) Remote engines have been
started Waiting for possible Shutdown/StopTestNow/Heapdump message on
port 4446 summary = 0 in 00:00:00 = ******/s Avg: 0 Min:
9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Tidying up remote # Mon May 29 13:07:43 IST 2017 (1496043463653) ...
end of run

Check the .jmx file you uploaded. If you are using any .csv file. Need to change the location of it. It will be pointing to your local machine. Change it to remote machines address

The answer is always in jmeter.log file:
Look into jmeter.log file on master for any suspicious entries
Run JMeter slave instance(s) like:
jmeter ${RMI_HOST_DEF} -Dserver_port=${SERVER_PORT:-1099} -s -j jmeter-server.log -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx -Dserver_port=xxxx -s -j jmeter-server.log
Look into jmeter-server.log file on remote slave(s)
Most likely your test fragment configuration is not correct. JMeter is not smart enough to copy dependencies (external .jmx files) automatically, you should copy it to all remote slave(s) manually prior to starting the test. The same applies to i.e. CSV configuration files, files you will be uploading, etc. Other reasons could be in:
0 threads (virtual users)
disabled thread group/transaction controller
incorrect test fragment reference
See the following guides for more information:
JMeter Distributed Testing Step-by-step
How to Manage Large JMeter Scripts With JMeter Test Fragments

Related

JMeter - Remote Testing on Linux

I am executing JMeter remote testing with 1 master machine (192.168.0.1) and with 7 slave machines with 3 VMs (192.168.0.2 to 192.168.0.4) on a network interface and 4 other VMs (192.168.0.5 to 192.168.0.8) are in a different network interface.
My JMeter script is located at Master machine - 192.168.0.1
I tried to execute my test with the following command
./jmeter -n -t /home/lup01/Document/LuP2021/ITonICE_Lasttest_InfluxDebug_09032021.jmx -l /home/lup01/Document/LuP2021/LuP2021_LastTest_001_14-10-2021_7VMs.jtl -R 192.168.100.2,192.168.100.3,192.168.100.4 -Djava.rmi.server.hostname=192.168.100.6,192.168.100.7,192.168.100.8,192.168.100.9
However, the test never started. the screen just hung and after 15 minutes i had to stop the test. I did the sample run only with 3 threads.
On course of debugging, i also checked that, when i executed the test with
./jmeter -n -t /home/lup01/Document/LuP2021/ITonICE_Lasttest_InfluxDebug_09032021.jmx -l /home/lup01/Document/LuP2021/LuP2021_LastTest_001_14-10-2021_7VMs.jtl -R 192.168.100.2,192.168.100.3,192.168.100.4
the test was running fine with 3 VMs which are on the same interface as the master machine
However, when i executed the 2nd part
./jmeter -n -t /home/lup01/Dokumente/LuP2021/ITonICE_Lasttest_InfluxDebug_09032021.jmx -l /home/lup01/Dokumente/LuP2021/LuP2021_LastTest_001_14-10-2021_7VMs.jtl -Djava.rmi.server.hostname=192.168.100.6,192.168.100.7,192.168.100.8,192.168.100.9
the test got executed but the load was generated only on the master machine (192.168.0.1). i validated this by printing the host name in the result file.
Can someone please guide me what changes i need to do to get the test running successfully and the load being generated at the slave machines 192.168.100.6 to 192.168.100.9?
JMeter Master machine doesn't generate any load, it only reads .jmx script, transfers it to slaves and collects results.
It doesn't make sense to run more than 1 JMeter process on 1 machine, it doesn't provide any benefit and just consumes resources, if you have only one machine - run a single JMeter process, just make sure to follow JMeter Best Practices and properly tune this JMeter instance for high throughput testing
If this is some form of an experiment and you have to run multiple JMeter processes on a single host and would like to bind different JMeter instances to different network interfaces - you can do it via "Advanced" tab of the HTTP Request sampler (or HTTP Request Defaults if you have more than one sampler) like it's described in Using IP Spoofing to Simulate Requests from Different IP Addresses with JMeter

How to deploy Apache-Jmeter-5.1.1 on Pivotal Cloud Foundary

I am trying to deploy an Apache-Jmeter (version 5.1.1), a stand-alone application on Pivotal cloud Foundry but unable to
I have the Apache-Jmeter (version 5.1.1) set-up running on my windows machine so I tried to push that directory/folder to PCF as an App but it failed with the below error
C:\Program Files\apache-jmeter-5.1.1>cf push apache-jmeter-5.1.1
Pushing from manifest to org dev-testing/ space Dev as user1...
Using manifest file C:\Program Files\apache-jmeter-5.1.1\manifest.yml
Getting app info...
readat C:\Program Files\apache-jmeter-5.1.1\bin\jmeter.bat: negative offset
FAILED
Here is my manifest.yml file looks like :
---
applications:
- name: jmeter-5-1-pcf
path: bin/jmeter.bat
memory: 512m
instances: 1
I should be able to run my Jmeter scripts (I mean test.jmx) from Pivotal Cloud Foundry, also It could be good if I can see the UI of Apache-Jmeter which was deployed on Pivotal Cloud Foundry
OK, easy answer first.
readat C:\Program Files\apache-jmeter-5.1.1\bin\jmeter.bat: negative offset
FAILED
It's failing because that's a Windows bat file, and you're trying to run it on Linux. You would want to run the .sh start script, and make sure you're pushing the .tgz download from the JMeter Binaries page.
Beyond that, it gets murky and depends on what exactly you want to run?
You could simply run jmeter from the command line, like here. In that case, you don't have a persistent running server though, which poses a problem because Cloud Foundry expects your app to run forever.
You could work around this by using a task instead. You would need to push JMeter as an app, let it stage then stop the app. After that you could cf run-task to execute jmeter -n -t plan.jmx ....
The other option would be to try and run JMeter remote, but that's not going to work well because JMeter uses Java RMI, which is not HTTP based so it would require use of Cloud Foundry TCP routes, or copious use of cf ssh to make tunnels. Neither are great options.
I would suggest using the cf cli. A quick test, the following worked for me.
Download the .tgz binary release from JMeter's web site.
Add the following .cfignore file. It just skips stuff you don't need.
NOTICE
LICENSE
README.md
docs
printable_docs
licenses
extras
Add a file .profile. This will set a couple env variables to make JMeter work.
export JAVA_HOME=.java-buildpack/open_jdk_jre/
export PATH=$PATH:$JAVA_HOME/bin
Put your .jmx files into the JMeter directory.
Then run cf push -b java_buildpack -m 1G -c 'sleep 9999' -u process --no-route jmeter-cli.
The app should start and do nothing, immediately run cf stop jmeter-cli. You just need to do this so that the app stages.
Then run cf run-task jmeter-cli './bin/jmeter -n -t your-test.jmx'.
Run cf logs --recent jmeter-cli and see the results. Or run cf logs jmeter-cli in a second terminal and stream them as the task runs.
Example output:
2019-09-08T22:06:35.72-0400 [CELL/0] OUT Cell e5f61515-c164-4c36-9686-faa2a0a363ed creating container for instance 29a1deb6-04c1-4105-91f8-0a8a5dadf367
2019-09-08T22:06:36.56-0400 [CELL/0] OUT Cell e5f61515-c164-4c36-9686-faa2a0a363ed successfully created container for instance 29a1deb6-04c1-4105-91f8-0a8a5dadf367
2019-09-08T22:06:41.18-0400 [APP/TASK/4e6e54e6/0] ERR Sep 09, 2019 2:06:41 AM java.util.prefs.FileSystemPreferences$1 run
2019-09-08T22:06:41.18-0400 [APP/TASK/4e6e54e6/0] ERR INFO: Created user preferences directory.
2019-09-08T22:06:41.61-0400 [APP/TASK/4e6e54e6/0] OUT Creating summariser <summary>
2019-09-08T22:06:41.61-0400 [APP/TASK/4e6e54e6/0] OUT Created the tree successfully using Test Google.jmx
2019-09-08T22:06:41.61-0400 [APP/TASK/4e6e54e6/0] OUT Starting the test # Mon Sep 09 02:06:41 UTC 2019 (1567994801615)
2019-09-08T22:06:41.63-0400 [APP/TASK/4e6e54e6/0] OUT Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
2019-09-08T22:06:43.66-0400 [APP/TASK/4e6e54e6/0] OUT summary = 30 in 00:00:02 = 19.9/s Avg: 99 Min: 60 Max: 450 Err: 0 (0.00%)
2019-09-08T22:06:43.66-0400 [APP/TASK/4e6e54e6/0] OUT Tidying up ... # Mon Sep 09 02:06:43 UTC 2019 (1567994803664)
2019-09-08T22:06:43.66-0400 [APP/TASK/4e6e54e6/0] OUT ... end of run
2019-09-08T22:06:44.39-0400 [APP/TASK/4e6e54e6/0] OUT Exit status 0
The only other thing to mention is that you can use the -l option and write the output to a JTL file. If you do that, it will write to the local file system and when your task ends that file will disappear, you won't be able to get it.
If you need to write the results to a JTL file, then you will also need to modify the task command that you run to, upon completion of JMeter, upload the results file to persistent storage like S3.
Hope that helps!

Jmeter Distributed Setup works in GUI but not the command line

I am running Windows 7 Pro with JMeter 4.0 r1823414 on all 5 machines with Java JDK 1.8.0_144 on all of them as well. All paths and ENV Vars are identical across all machines. I set my remote hosts in the master and I am able to see them on the GUI inside the master. I built the rmi_keystore.jks on a slave machine and copied it into the bin folder in every machine. I successfully started all the servers on the slave machines and see the successful attachment of the rmi (running the jmeter-server.bat):
Found ApacheJMeter_core.jar
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files
(x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"
Created remote object: UnicastServerRef2 [liveRef: [endpoint:
[<ip:port>,SSLRMIServerSocketFactory(host=<host_name/IP>,
keyStoreLocation=rmi_keystore.jks, type=JKS,
trustStoreLocation=rmi_keystore.jks, type=JKS, alias=rmi),
SSLRMIClientSocketFactory(keyStoreLocation=rmi_keystore.jks, type=JKS,
trustStoreLocation=rmi_keystore.jks, type=JKS, alias=rmi)](local),objID:
[<stuff>:-7fff, <more_stuff>]]]
Running a basic HTTP call I am able to run from the master to all 4 slave machines (individually and all at once) and get results without issue from the GUI. My problem is from the command line. I cannot get the test to run. I have tried:
jmeter -n -t distributed_test_4_slaves.jmx -r -l distributedLog_Test.jtl -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks
jmeter -n -t distributed_test_4_slaves.jmx -r -l distributedLog_Test.jtl
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_names> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_names:ports> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_ips(with and without ports)> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
Every time I get the same errors in the command line:
Creating summariser <summary>
Created the tree successfully using distributed_test_4_slaves.jmx
#The next 5 lines repeat for each slave
Configuring remote engine: <slave_1..4>
Exception creating connection to: <slave_1..4>; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot
find the file specified)
Failed to configure <slave_1..4>
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote
engines could not be configured:[
<slave_1>, <slave_2>, <slave_3>, <slave_4>]
What am I missing? Why would it run and work in the GUI but not on the command line? Something cannot be right.
Make sure that
You either run JMeter from its "bin" folder
Or have rmi_keystore.jks in the folder where you're running JMeter from
as the error clearly states that JMeter tries to load rmi_keystore.jks file and fails
One more thing to try is providing full path to the rmi_keystore.jks file via server.rmi.ssl.keystore.file property.
You can also completely disable secure RMI communication by setting server.rmi.ssl.disable property to true
Normally jmeter.log file should contain the root cause of the issue, if it doesn't or not very informative - you can increase JMeter log verbosity for selected clas(ses) or package(s).

Unable to connect to remote machine in jmeter

I am trying to launch my jmeter tests in a remote machine as i will be running bulk users on a .jmx file (Approx 200 000 threads). I have a remote machine where i have downloaded jmeter and saved the folder in desktop. and in command prompt i have a command
Desktop\apache-jmeter-4.0\bin>jmeter-server -n
Could not find ApacheJmeter_core.jar ...
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Created remote object: <Have a message saying the server is up and running>
Now in jenkins i have a command
export JAVA_HOME=/java/1.8.0.65
bin//jmeter -n -R <Remote HOst IP> -t file.jmx -l result.jtl -e -o/resultfolder
When i trigger the job in jenkins i am getting
Configuring remote engine: <Remote machine IP>
Exception creating connection to: <Remote machine IP>; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
Failed to configure <Remote machine IP>
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:<Remote machine IP>
I have a rmi keystore file created in remote machine.
You need to launch create-rmi-keystore.sh script on all machines and make sure that the configuration is the same, this way communication between JMeter master and slaves will be secure.
More information: Remote Testing: Setting Up SSL
If you don't want the communication between the master and slaves to be secure - you can amend the command line to:
jmeter -Jserver.rmi.ssl.disable=true -n -R <Remote HOst IP> -t file.jmx -l result.jtl -e -o/resultfolder
or add the next line to user.properties file on all hosts to make the change permanent:
server.rmi.ssl.disable=true
JMeter restart will be required to pick the property up. See Configuring JMeter user manual chapter for more information.
Depending on your test nature 1 slave might be not enough to simulate 200k threads so make sure you're following recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article and keeping an eye on JMeter engines health using built-in OS tools or JMeter PerfMon Plugin as if JMeter will not be able to send requests fast enough - you will get lower throughput/higher response times even if your application is not overloaded.

Unable to start Jmeter

unable to Jmeter in distribution load, getting below error please help am using jmter v3.0.20160606
Changing to JMeter home directory
Could not find ApacheJmetercore.jar
Trying JMETERHOME=
Found ApacheJMeter_core.jar
This is expected and normal, now you need to launch a JMeter Master like:
jmeter -R xxxxx -n -t test.jmx -l result.jtl
Replace xxxxx with IP address or hostname of the machine where you launched Slave node, you should see something like:
Starting the test on host xxxxx # current date and time
More information:
Remote Testing
How to Perform Distributed Testing in JMeter
JMeter Distributed Testing Step-by-step
The first of JMeter Best Practices is Always use latest version of JMeter so consider upgrading to JMeter 3.3 (current version) or whatever will be available at JMeter Downloads page on next available opportunity

Resources