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.
Related
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
WHAT I HAVE:
Huge Jmeter agents network, 1 master + many slaves.
Master sends tasks to Slaves, they start test execution and report data to Master.
WHAT I WANT:
Be able to modify inputs (passed as global properties to Master, -G) on the fly, while test is executed, without necessity to stop/restart test.
WHAT I KNOW:
I can use BeanShell server to modify Jmeter properties while running the test. It works fine. But BeanShell server starts only on Master, not on Slaves.
Master sends -G properties to Slaves only once, before test execution. Even if Master properties are updated, slaves never get this information until test is restarted.
QUESTION:
How can I modify properties on Slaves as well? Is there any proper solution?
WHAT I THOUGHT ABOUT:
Well, I can do the same trick with BeanShell server for every Slave node too. But this solution doesn't look really ideal for me as I have a lot of agents and have to update all of them. It takes time.
I can change my test logic to update properties from file periodically, and then modify files on Slaves on the fly. Looks even easier for me than #1 as it's cheaper to modify a file over ssh remotely then to launch a separate server on every node.
Actually, all I need in fact is to write a proper method/function for BeanShell server that not only changes properties locally but informs Slaves about it. I'm not so familiar with Jmeter source code yet (just started) but know that it's already implemented inside the code as a part of remote launching procedure. So, if you can point me to the right class to take a look into - it can help me a lot.
Any ideas appreciated. Thanks in advance.
You can add to your Test Plan Property File Reader which will read and update properties in Slaves, you can add properties on runtime in Master using Beanshell/JSR233 element.
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
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)
I'd like to run a distrubuted JMeter test on our site, following the
manual. My tests are parametrized via a CSV DataSet configuration element to simulate diffent users. The question is now: Will JMeter use the same DataSet for each slave, or can I somehow configure each slave with its own dataset? If the first is the case, slaves will steal each other's session which is of course undesired.
Jmeter use local CSV fiels in distributed mode. So you just place different files on each slave and it works. Nothing special to do.
You can choose the CSV Data behaviour with the Sharing mode option. Description of each option detailed in:
http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config