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

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)

Related

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.

JMeter Remote testing - 2 slaves

I'm executing JMeter loadtest on my system. We have 1 client server with JMeter GUI and 2 slaves servers.
e.g.
client: 192.168.1.1
slave1: 192.168.1.2
slave2: 192.168.1.3
We are testing application where I need to login, do something and logout.
Is it possible to test such application with 2+ slaves? Because I cannot login with the same user more times on server in current session. I get license error: "User is connected from another machine".
I know, that jmeter multiplies Threads with number of slaves, but how to handle this situation?
Thanks
JMeter uses local CSV files in distributed mode. So you just place different files on each slave and it works.
For distributed testing, the CSV file must be stored on the server host system in the correct relative directory to where the JMeter server is started.
According to the Apache JMeter documentation,
By default, the file is only opened once, and each thread will use a different line from the file. However, the order in which lines are passed to threads depends on the order in which they execute, which may vary between iterations.
If you want each thread to have its own set of values, then you will need to create a set of files, one for each thread. For example test1.csv, test2.csv, …, testn.csv. Use the filename test${__threadNum}.csv and set the "Sharing mode" to "Current thread".
So just put your different credentials in different CSV.
Either of below solutions will address your issue. I use Redis. It is super cool.
Redis:
http://www.testautomationguru.com/jmeter-make-data-sharing-easy-in-distributed-mode-using-redis/
HTTP Simple Table Server:
https://jmeter-plugins.org/wiki/HttpSimpleTableServer

jmeter agents running specific tests

I want to run a Jmeter test using multiple agents but I don't want each agent to run the same test.
How can I assign specific tests (thread groups) to a specific agent?
Thanks
Actually all JMeter remote slaves execute the same test plan so all the slaves should be doing the same stuff.
However you can change this behaviour by a trick with the help of the IF Controller and __machineName() or __machineIP() function like:
"${__machineIP()}" == "your_remote_slave_IP_address"
Demo:
As you can see, "Sampler 2" it not executed as IP address of the machine doesn't match the one, specified in the IF Controller

Setting up different number of users in JMeter master slave

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

How to locate web elements having dynamic Id's in a cluster of servers using JMeter?

I am using JMeter to test performance of the following Server Infrastructure. The Code Base uses ICEfaces framework and hence generates dynamic ID's each time there is a new build.
I record the scripts and run them for different variants of load (10 Users, 20 Users, 30 Users and so on). Whenever a new code base is deployed, because of change in ID's, I have to re-record the scripts before I perform Test runs again.
As of now I am able to satisfactorily get my job done.
I wish to take my job to a whole new level by trying to test performance on the following Server Infrastructure.
The following are my issues -
Because of two different nodes (Node1 and Node2) each node has a unique set of dynamic ID's associated with it and when I record a script on a particular login session, I cannot be sure of the Node my session is pinned on and as a result the recorded script is tailor made for a single node and not a cluster.
When "Load Balancer" gets in action, I cannot be sure of the Node JMeter hits during performance run and for obvious reasons the run fails to generate results.
I want a cleaver way to record script which can successfully run on a multiple server configuration.
How to perform performance Testing on this configuration?

Resources