JMeter showing wrong thread count in distributed testing - jmeter

I am using JMeter 2.13 and have 2 thread groups,for each thread group i assigned 25 users.
I am running the test in distribution mode using 2 machines as slaves.
But the total user count is showing as 50 only,But it should be 100 as per my understading(50*2 slaves=100 Users,Correct me if am wrong)
I have added some listeners by adding JMeter plugins and they are also showing the total user count as 50 only.
Looking forward for answer...
Regards.

You must put in Thread Group name some information to uniquely identify each injector:
http://jmeter-plugins.org/wiki/ActiveThreadsOverTime/
For example:
${__machineName()}_My Threadgroup name
Based on your last comment, your issue is most probably that 1 injector(server) is not able to contact controller (client) to report its progress.
Check logs of each jmeter-server.

Related

Unable to Run Multiple Sampler APIs using Ultimate Thread Group in Jmeter

I have Four Sampler APIs : 3 GET APIs and One Put API and want to do spike test using UltimateThread Group. So i created an ultimate thread Group and added the four APIS under them.I have given split 25 user within different hold time and ramp-up time as per below image. But whenever i am running it is only running the first two API sampler and the last two apis are not running at all.
another issue is that among the two running APIs, only one API is running with 25 threads and other one with only 5 threads ....but its should run 25 threads for each APIs .Kindly let me know whats the issue and as i am new to Jmeter ..trying to resolve the issue but unable to do troubleshoot it.
APIs Sampler
Ultimate thread Group Set-up : AGGregate Report : TREE REPORT
AS YOU CAN SEE THERE FOUR APIS BUT IT HAS EXECUTED ONLY TWO APIS, AMONG THE TWO OF THEM,
ONE HAS 25 THREADS
ONE HAS 5 THREADS
BUT as per my understanding it should run all four APIs with 25 threads for each API sampler...
Each user in the Ultimate Thread Group runs for 10 seconds maximum
Average Response Times for first 2 Samplers are 12 and 32 seconds correspondingly
The threads shut down times and reasons can be seen in jmeter.log file
Assuming above 2 factors the threads are simply being shut down before starting 3rd and further Samplers.
You need to either:
Set "Hold load for" to a bigger value, i.e. a couple of minutes
Or introduce reasonable response timeouts under "Advanced" tab of the HTTP Request Defaults so if the response time exceeds acceptable

jmeter - I would like to know if it's possible to have login as part of the set up and logout as part of tear down for 250 concurrent users

I have scenario where I want to run load test for 250 users.
Ramp up time is 10 mins for 250 users and run test for 50 min duration.
Question 1 : Is it recommended to do login and login out as part of set and tear down .. as the dev team does not measure login and log out .?
Question 2 : How do i keep the the other thread group in loops during the 50 min duration . ?
I wouldn't go for it as normally different thread groups should represent the different groups of virtual users, setUp thread group is for accomplishing the pre-conditions for the test and tearDown thread group is for cleaning everything up. If you perform the login in the setup thread group - there will be negative consequences like having to pass login context (tokens, headers, cache, etc.) to other thread groups. So I would rather move login to be the integral part of the main thread group and if needed remove login/logout via Filter Results Tool (not part of vanilla JMeter, can be installed using JMeter Plugins Manager)
It can be done on either on Thread Group level like this:
or you can "loop" the arbitrary part of the test by putting it under the Runtime Controller:

Apache Jmeter Load Test to achieve that only one thread starts until test achieve the desired number of users

I have implemented a testplan in Apache Jmeter to measure how the system serves the request with XY users.
Steps:
User Login via a web browser with username and password
After the login, user click on the given link which starts a job on the server
When I configure thread group with the GIVEN number of users I can see the Jmeter stars thread within the given time range. Like this:
1 user --> starts 1 job
2 users --> starts 1 + 1 job
3 users --> starts 1 + 1 + 1 job
...
So When the test ends I have 6 started job instead of 3 :(
So my question is:
How it is possible that every time starts only one job within the given time range to achieve the predefined user number?
For example:
If I have 10 users I would like to see only 10 started jobs at the end of the test.
If I have 100 users I would like to see only 100 started
jobs at the end of the test
Here is the Expected Active Users Count, where you can see that when the test achieved the 10 users there are more than desired job started because the active users' number increased +1 after the previous thread ends.
Expected Active Users Count
If you need to execute a job by a user only once it's better to consider switching to the "normal" Thread Group configured like:
If you want to continue using the Ultimate Thread Group - put your request(s) which trigger the job creation under the Once Only Controller, but in this case you will see a lot of error messages in the jmeter.log file (which can be supressed if you're fine with this approach)

Distribution of throughput among different thread groups in jmeter

Below is the actual volume i need to achieve in 1 hour of my jmeter load test.
Required Request/second=0.14 (520/3600)
Hence i have Throughput shaping timer with Start RPS and End RPS as 0.14 for 3600 Sec.
i have 2 thread groups.
Thread group 1 has transactions- Launch and Login.
TG1
**Thread Group**
Launch
Login
Thread group 2 has Action1 and Action2 transactions.
TG2
**Thread group**
**Action1**
**Action2**
Having all these under one thread group ,i can achieve anticipated load using combination of No Of threads required and Throughput COntroller.
But here my requirement is ,i have transactions in different thread groups.
Can anyone tell my how can i distribute the throughput for two different Thread groups.
You should be able to apply the same approach as for the single Thread Group to any amount of Thread Groups.
Throughput Controller obeys JMeter Scoping Rules so if you place it to be as a child of the 2nd Thread Group - it will not have any impact on other Thread Groups
Also be aware that in some cases it's easier to use Switch Controller for requests distribution, check out Running JMeter Samplers with Defined Percentage Probability article for more details.
If you are targeting for specific number of requests per second the best approach is to use
bzm - Arrivals Thread Group
It automatically adjusts userload and maintains target RPS levels.
You are targeting 0.14 request per second that means 8.4 requests per minute so in arrivals thread group enter 8 arrivals per minute (It accepts only whole numbers so you can round off to 8 or 9)
Enter Rampup rate steps and maximum number of concurrent users (This helps to limit max number of users )
And inside the thread group you can use throughput controllers to control your transaction executions as shown in above screenshot.
Please refer to the sample test plan from the link ( you can find it in details section of the report).

How to prioritize multiple controllers in Apache JMeter

I have a requirement in JMeter, while executing several recorded HTTP Request (placed inside Transaction Controller) in Thread Group, They should start its execution from one by one ie) Controller 1, Controller 2, ... & Final Controller.
But when I gave 100 threads it start execute, Controller 1 for 100 times then Controller 2 for 100 times and it continues the same till last controller.
From the above shown image you can verify my results. And I need to know, how can I prioritize my controllers when I gave multiple thread counts. My exact output for 100 threads should be like as mentioned below,
1. Controller 1, 2, and till final controller should run as 1st thread count
2. Controller 1, 2, and till final controller should run as 2nd thread count
3. Same like it should continue till the 100th thread count
Please let me know how this requirement is possible in JMeter 4.0
Thanks in advance
This is default JMeter behaviour, JMeter threads (virtual users) are absolutely independent so:
When you start your test with 1 user it starts executing Samplers upside down, one by one
When you start your test with 100 users - all 100 users start executing samplers upside down. And given you have 100 concurrent users it might be the case that first sampler is being executed by multiple users at once.
Normally this is what the majority of people require. If you got the requirement to run all requests by 1st user followed by all request by 2nd user and having 100 users in parallel - suggest the person, who gave you this requirement to quit IT and become a lawnmower as the requirement doesn't make sense and is contradictory.
You can still achieve it using Concurrency Thread Group configured like:
Which will give you what you're looking for:
You can install Concurrency Thread Group using JMeter Plugins Manager.

Resources