PerfMon plugin throwing error (with use of variables) in JMeter distributed Mode - jmeter

I have implemented PerfMon Metrics Collector (listeners) in my JMeter scripts. These listeners have HOST and PORT fields. I have defined variables for these in Test Plan and using them in listeners.
I tested these scripts in non-distributed mode and it worked perfectly.
Now, I converted my scripts for distributed mode. Everything works fine except PerfMon listeners which throw following error message:
2016/02/29 09:06:35 ERROR - kg.apc.jmeter.perfmon.PerfMonCollector: Perfmon plugin error: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine
This error seemed to be related to invalid value (may be these listeners do not handle special characters like {} $ in distributed mode!!). So, I removed variables for HOST/PORT and instead used hard coded values and it worked fine.
So apparently, these listeners do not work properly in distributed mode (IF used with variables).
Is there any workaround for this issue as I have plenty of PerfMon listeners in my setup and manually changing them all will be a tiresome job.

Go for JMeter Properties instead of JMeter Variables, like:
Substitute ${HOST} with ${__P(HOST,)}
Substitute ${PORT} with ${__P(PORT,)}
Pass HOST and PORT properties values on JMeter master side like:
jmeter -GHOST=target_hostname_or_IP -GPORT=target_port -s -n -t ....
You can have different values on different slaves, in that case specify properties in user.properties file (it's located under /bin folder of JMeter installation) like:
HOST=10.20.30.40
PORT=1234
Remember to restart JMeter after editing any configuration file.
References:
__P() function documentation
Full list of command-line options
Apache JMeter Properties Customization Guide

Related

JMeter - Add Client side Certificate and key

How can we add a client-side certificate and key to JMeter Script?
Every time I'm navigating to JMeter -> Options -> SSL Manager and browsing the Certificate and entering the password then it's only allowing me to run the script successfully, else I'm getting the forbidden error access denied.
I have tried the below steps, but still facing the same issue:
Added below lines in JMeter properties:
javax.net.ssl.keyStoreType=pkcs12
javax.net.ssl.keyStore=C:\certs\mycert.p12
javax.net.ssl.keyStorePassword=password
Tried using the JSR223 Sampler in JMeter script but still no luck.
Thanks in advance.
Forget about jmeter.properties file, any customization of JMeter Properties should be done in user.properties file or in a separate copy of jmeter.properties which needs to be passed to JMeter via -p command-line argument
In your case you're trying to change System Properties so you need to put these lines to system.properties file
JMeter restart will be required to pick the properties up
More information:
Configuring JMeter
How to Set Your JMeter Load Test to Use Client Side Certificates

How to create 8 instances with 500 users each using Non-GUI mode in Jmeter

I have a requirement to run 4000 users. I just wanted to run that using Non-GUI. How can we create 8 instances with 500 users each using Non-GUI mode in Jmeter. Suggest the possible scenario with an example.
Get 9 machines somewhere somehow
Install Java 8+ (it's the per-requisite to run JMeter 5.4)
Install JMeter onto all machines. If you plan to use JMeter Plugins make sure that all the plugins are installed on all machines
If your test depends on external files or libraries - make sure that all the libraries and/or files are copied to the JMeter Machines
If you plan to use secure communication between master and slaves follow Setting Up SSL JMeter Documentation chapter, if not - add the next line to user.properties files on all machines:
server.rmi.ssl.disable=true
Run jmeter-server on 8 machines which will be acting as slaves
Add the next line to user.properties on the master machine
remote_hosts=ip_address_of_slave1,ip_address_of_slave_2, etc.
Make sure that the machines are on the same subnet and there is no firewall blocking connections between them
Run your test as:
jmeter -r -n -t /path/to/your/test.jmx -l /path/to/results.jtl
When the test finishes analyze your results by using Listeners or generating HTML Reporting Dashboard
More information:
Remote Testing
How to Perform Distributed Testing in JMeter

What update is needed in jmeter.properties and jmeter-server files to create a JMeter Remote Load Test

I am using jmeter 5.4.1, and facing issue while setting up the whole environment for that.
I have firewall in between master and slave machines.
I can request for some ports to open but before that I want to know how to configure them?
What update is needed in jmeter.properties and jmeter-server files to create a JMeter Remote Load Test.
In jmeter.properties nothing, don't touch this file, perform all the configuration either in user.properties or via -J command-line arguments.
Coming back to your question, I believe the official documentation is quite comprehensive, however just in case you cannot or unwilling to read:
In the master:
remote_hosts=ip,addresses,or,dns,hostnames,of,slaves,separated,by,comma
client.rmi.localport=xxxx
In the slave(s):
client.rmi.localport=xxxx
server.rmi.localport=yyyy
If you don't want secure communication between master and slaves - add the next line to both as well:
server.rmi.ssl.disable=true
So in the firewall you need to open these xxxx and yyyy ports
More information:
Apache JMeter Distributed Testing Step-by-step
Remote hosts and RMI configuration
JMeter Distributed Testing with Docker

I can't get 'create-rmi-keystore.bat' to run on windows, is there a solution to this?

I am new to Jmeter 5.1.1 however I am in the process of setting up a remote testing with it.
One step I'm having trouble with is running 'create-rmi-keystore.bat' when I double click it nothing happens. I have tried to open it using the command line and get the following message.
'keytool' is not recognized as an internal or external command,
operable program or batch file.
"Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'"
I don't seem to have a rmi-keystore.jks .
Has anyone managed to solve this issue?
You don't have keytool utility in your Windows PATH, all you need to do is to ensure that it's there.
Solution using Windows Command Prompt would be:
set PATH="path\to\bin\folder\of\your\JDK\or\JRE\installation";%PATH%
In general if you don't need the secure RMI communication between JMeter master and slave machines (and 99% of people don't need this as it doesn't add any value and only creates overhead in terms of CPU and RAM) you can just disable this functionality by adding the next line to user.properties file:
server.rmi.ssl.disable=true
References:
Remote hosts and RMI configuration
Apache JMeter Properties Customization Guide
If you do this on JMeter master and all the slaves you will not have to worry about the RMI keystore, but I would still recommend having the keytool in the PATH otherwise you will not be able to use HTTP(S) Test Script Recorder for recording secure traffic.

JMeter Error is showing for distributed environment

I have Set up everything, running Jmeter-Server.bat file in slave system, added IP in Jmeter.properties. It was running before one month properly, but when I am trying to run, Its showing me the Error.
Most probably there is a mismatch between certificates in master and slave(s) or 7 days had passed since the last keystore creation so the certificates are exired now.
Either follow steps from Setting up SSL one more time and make sure to use exactly the same rmi_keystore.jks file on master and all the slaves or define the following property:
server.rmi.ssl.disable=true
This can be done either by adding the above line to user.properties file or alternatively you can provide it using -J command-line argument like:
jmeter -Jserver.rmi.ssl.disable=true ..... - on master
jmeter-server -Jserver.rmi.ssl.disable=true ..... - on slaves
More information:
Remote hosts and RMI configuration
Apache JMeter Properties Customization Guide
Overriding Properties Via The Command Line

Resources