Setting up different number of users in JMeter master slave - jmeter

In my JMeter master-slave setup, I want to setup a different number of users in each slave for the same thread group.Is it possible to setup with properties file? Is there any other way?
In Load Runner we can configure this easily with Load Generators. How to do in JMeter?

I would recommend doing it as follows:
In your Test Script define number of users using __P() function like ${__P(users,)}
In user.properties file on each slave machine specify the desired number of users like:
users=50
You can also pass the value via -J argument like:
jmeter -Jusers=100 ...
References:
How to do remote testing the 'proper way'?
Apache JMeter Properties Customization Guide

Related

Dynamic value to JMS PTP fields in Jmeter

I have been trying for weeks now to find a way to handle jmeter script using only single thread group & pass connection variables dynamically by CSV file in which I'm failing terribly. I have multiple value in place of QueueConnection few test cases have message properties as well. I would like to find a way to eternalize is & use single thread group to achieve it.
Check the screenshot an example of variable which should take value dynamically from a file is what I'm expecting.
enter image description here
I don't think you will be able to use CSV file, you will have to go for JMeter Properties instead.
And in the JMS P2P Sampler you need to use __P() function to read the properties values
Something like:
The properties along with their respective values can be:
put into user.properties file like:
queueConnectionFactory=ConnectionFactory
passed via -J command-line arguments like
jmeter -JqueueConnectionFactory=ConnectionFactory
put into a separate .properties file, in this case you will need to "feed" this file to JMeter via -q command-line argument like:
jmeter -q /path/to/your/custom/JMS.properties -t test.jmx ...
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
Full list of command-line options

How to pass properties files to Jmeter server in distributed setup

I have Jmeter distributed setup (One client and one server).
In single jmeter instance I'm using the below command to execute jmeter with a properties file that will pass the user defined variables to my test script
/apache-jmeter-5.3/bin/jmeter -p reco.properties -n -t Performance.jmx -l test2server.csv
When I tried to use the same command including the server configurations I noticed that the values defined in my "reco.properties" are not picked at the test execution.
Instead I need to pass all the variables with "-G" argument. Ex:
/apache-jmeter-5.3/bin/jmeter -GENV=test -n -t Performance.jmx -l test2server.csv
is it possible that I can pass all variables in a properties file for Jmeter Server as I do in the normal execution with "-p"?
Thank you
As per JMeter Documentation:
If the test uses any data files, note that these are not sent across by the client so make sure that these are available in the appropriate directory on each server. If necessary you can define different values for properties by editing the user.properties or system.properties files on each server.
So currently as per JMeter 5.4 this is not supported, you either need to pass the properties one-by-one like -Gprop1=value1 -Gprop2=value2 or to copy the .properties file to all the slave machines
The limitation can be also worked around via getting the properties from a dataabse using JDBC Request sampler or with plugins like HTTP Simple Table Server or Redis Data Set
If you do believe that the feature is essential you can try raising an enhancement request in JMeter Bugzilla

jmeter distributed testing slaves not reading the property when properties are sent with -G option

I am able to successfully run JMeter in master slave configuration in both GUI and non GUI mode when the user defined variables are hardcoded in the test plan. But now I am trying to set these with properties using the
-Gglobal.properties option on master where I have the properties defined in the global.properties file.
Then I am using ${__property(concurrent.threads)} function in the User defined variables.
When I run the remote test I see the property being set to the literal "concurrent.threads" and the test fails to run. The jmeter manual for __property reads:
If the property value cannot be found, and no default has been supplied, it returns the property name
why are the properties not being sent to the slaves, is there a bug in JMeter?
I also tried -Gconcurrent.threads=100 in the command line options and I still get the same behaviour.
Looks like it worked for some other user in 2015 --
How to configure the number of threads to run on slave machines in Jmeter?

JMeter - Bandwidth control not working

I'm attempting to run a testplan using different qualities of network.
To accomplish this I set a "HTTP Request Default" so they all use HTTP 3.1 or 4.
Then I passed the properties as follows:
-Jhttpclient.socket.http.cps=21888 -Jhttpclient.socket.https.cps=21888
However it doesn't seem like it's doing much, do I need to enable the setting in the user.properties as well (to maybe 0) which I can then overwrite with the property?
I am doing this with a distributed test plan (multiple load generators in non-gui mode) but since they are all started through the one "master" node I would think they would all take the property.
You need to start all the slaves using these -J command-line arguments or modify user.properties file on each slave in order to make it work.
Properties are not being automatically passed to slaves from the master node. You can also try out -G key, as per Full list of command-line options
-G, --globalproperty <argument>=<value>
Define Global properties (sent to servers)
e.g. -Gport=123
or -Gglobal.properties
Also remember that all slaves are quite independent so each of them will have 21888 characters per second throttling so cumulative bandwidth will be sum of all slaves.
See How to Simulate Different Network Speeds in Your JMeter Load Test article for more information on simulating different networks during JMeter test.

How to run Jmeter remotely on multiple slaves to stress multiple servers

I have a requirement wherein I need to run different jmeter testplans on different target servers. I went through this PDF here, but it does not meet my requirements. It explains how to stress a "single" webserver from different slaves using single jmeter master. But my requirement is to stress different servers from different slaves using single jmeter master. One way I could find is like below
Open multiple jmeter GUI instances on the jmeter master.
Create different testplans in each jmeter instance (basically these testplans differ only in terms of target server and login information)
Go to Run -> Remote Start -> Choose different slave in each instance
But I don't like this myself. Is there any better way to achieve this..?
Not sure that it`s a best way, some workaround:
Start the jmeter servers with some parameter :
SERVER_PORT=44444 ./jmeter-server -Jparam=1 &
SERVER_PORT=44445 ./jmeter-server -Jparam=2 &
SERVER_PORT=44446 ./jmeter-server -Jparam=3 &
Add this parameter in your testplan (in user defined variables):
And in testplan add a thread group and inside of this thread group a several If controllers with conditions like a ${__javaScript(${param}==1)}. Inside these If controllers put your different testplans:
Theriotically, they will start to work with different "branches". Also you can change the number of users depends of this parameter by using Beanshell and to use different pools for user names/password using CSV controller. ( /home/pools/${param}/pool.csv)

Resources