Understanding difference between thread group properties - jmeter

i've started distributed performance testing using jmeter. If i give scenario 1:
no.of threads: 10
ramp up period: 1
loop count: 300
Everything runs smooth, as scenario 1 translates to 3000 requests in 300 seconds. i.e. 10 requests per second.
If i give scenario 2:
no.of threads: 100
ramp up period: 10
loop count: 30
Afaik, scenario2 is also executing 3000 requests in 300 seconds, i.e. 10 requests per second.
But things started failing i.e. sever is facing heavy load and requests fail. In theory both scenario1 and scenario2 should be same, right? Am i missing something?
All of these are heavy calls, each one will take 1-2 seconds under normal load.

In ideal world for scenario 2 you would have 100 requests per second and the test would finish in 30 seconds.
The fact that in 2nd case you have the same execution time indicates that your application cannot process incoming requests faster than 10 per second.
Try increasing ramp-up time for 2nd scenario and look into the following charts:
Active Threads Over Time
Response Times Over Time
Transactions Per Second
Normally when you increase the load the number of "Transactions Per Second" should increase by the same factor and "Response Time" should remain the same. Once response time starts growing and number of transactions per second starts decreasing it means that you passed the saturation point and discovered the bottleneck. You should report the point of maximum performance and investigate the reasons of the first bottleneck
More information: What is the Relationship Between Users and Hits Per Second?

In scenario 2 after 10 seconds you have 100 concurrent users which execute requests in parallel, your server may not handle well or prevent such load
Concurrent user load testing sends simultaneous artificial traffic to a web application in order to stress the infrastructure and record system response times during periods of sustained heavy load.
In scenario 1 after 10 seconds you have 10 concurrent users looping through the flow, without causing a load on server
Notice your server may have restriction on number of users requesting only on specific request(s)

We shall be very clear about the Rampup time
Following is extract from the official documentation
Scenario 1 : no.of threads: 10
ramp up period: 1
loop count: 300
In the above scenario 10 threads(virtual users) are to be created in 1 seconds. Each user will loop 300 times. Hence there will be 3000 requests to the server. Throughput cannot be calculated in advance with above configuration. It fluctuates based on the server capability, network etc. You could control the throughput with some components and plugins.
Scenario 2 : no.of threads: 100
ramp up period: 10
loop count: 30
In scenario 2 100 threads (virtual users) are created in 10 seconds. 100 virtual users will send requests concurrently to the server. Each user will send 30 requests. In the second scenario you will have higher throughput (number of requests per seconds) as compared to the scenario 1. Looks like server cannot handle the 100 users sending requests concurrently.
Ramp up time is applicable for the first cycle of each thread. It will simulate delays between first request of each user in their first iteration.

Related

jmeter thread group vs Constant Throughput Timer

I am conducting a performance test (TPS) using jmeter.
I am requesting about 10,000 TPS, but the following two results are different.
(Position that 10,000 TPS responds normally)
1000 thread x 600 target throughput(in samples per minute)
100 thread x 6000 target throughput(in samples per minute)
I think the two results should be the same, but why is the response time delayed as the thread increases?
I think the two results should be the same - why they would be the same?
Let's imagine your system has fixed response time of 1 second, in that case:
With 1000 threads you will get 1000 requests per second and you can limit the throughput to 10 requests per second using the Constant Throughput Timer
With 100 threads you will get 100 requests per second, no limiting is required
And what if response time is 2 seconds?
With 1000 threads you will get 500 requests per second
With 100 threads you will get 50 requests per second
Constant Throughput Timer:
acts precise enough on "minute" scale, if your test lasts less than minute it might not apply the throughput
can only pause the threads to limit the throughput (requests per minute) to the desired value. If current number of threads is not enough in order to conduct the required load - the time won't have any effect.
If you want to send requests at the rate of 10000 TPS it worth considering going for the Throughput Shaping Timer and Concurrency Thread Group combination connected via the Feedback Function in this case JMeter will be able to kick off extra threads if current number is not sufficient.
But also be informed that:
JMeter should be able to start as many threads as needed to send 10000 TPS so make sure to follow JMeter Best Practices or even consider going for Distributed Testing Mode
Application needs to be able to handle the load and respond fast enough, JMeter waits for the previous response before starting the new request so if application is able to serve i.e. 5000 requests per second only you won't be able to reach 10000 by any means

JMeter: Holding Session for a certain period of time

Is it possible to hold a session for a certain period of time using JMeter? While using "Ultimate Thread Group"
Ultimate Thread Group: 100 users will be ramping up and run for 15 minutes. Then another set of 100 user will be ramping up after 15 minutes and it will continue till it reaches 1000 users. No iteration and Total sample count should be 1000. Application session time out is 15 minutes. Logout transaction should execute once all 1000 users are reached.
Attached the load profile:
Load Profile
Total sample count should be 1000
this is not something that you can get for sure because the total number of requests you will be able to make using the above setup will depend mostly on :
your application response time
the nature of your test (i.e. think times)
You can use i.e. a Dummy Sampler where you can mimic various connect time, latency and response time and see what will be the number of requests you will make in 2.5 hours, however my expectation is that 1000 concurrent users will be able to conduct much more than 1000 requests given the test duration.
More information: What is the Relationship Between Users and Hits Per Second?
If you want to introduce a "hard limit" on the number of requests you can consider adding Throughput Controller in Total Executions mode.

JMeter - Cannot reach 15 000 requests in 5 minutes even though server is capable of it

I have a problem with JMeter that I can't figure out.
I have 3 requests in one thread group. Each request needs to be executed 5000 times in 5 minutes which means I need to execute 15 000 requests in 5 minutes altogether.
The thread group is set up like this:
Number of threads (users): 50
Ramp-up period: 1
Loop count: forever
Duration (seconds): 300
Each request has a Constant throughput Timer:
Target throughput: 1000.0
Calculate Throughput based on: all active threads in current thread group
And the results after the test run is complete are around 2000-3000 requests and that is too low. I can't figure out which settings are wrong.
Tests are ran in non-GUI mode on an Azure virtual machine with a Intel Xeon E5-2673 #2.3 GHz with 16 cores and 32gb of RAM and the server is more than capable of executing more requests since the response time is about 1 second so hardware should not pose a problem. JMeter heap memory is set to 12 GB.
Any help is appreciated!
I have 3 requests in one thread group. Each request needs to be executed 5000 times in 5 minutes which means I need to execute 15 000 requests in 5 minutes altogether.
That means you have to execute thread group for 5000 times in 5 mins => 300 seconds. If you execute thread group that much of time, you will automatically generate 15k requests.
From Documentation:-
Loop Count Number of times to perform the test case. Alternatively, "forever" can be selected causing the test to run until manually stopped.
When you set loop count: forever or any value in loop count for that matter, it means you want next set of users(threads) [which you have defined as 50 now], only when you are done with the first set 50 users request (150 requests as each thread group as 3 requests). Now, this 50 users request may take unexpected time and your next set will be returned only after this 50 users are done.
So to solve the problem at hand, you should have the following configuration for the thread group :
Number of threads (users): 5000
Ramp-up period: 300
Loop count: 1
So this means after every second around 17 Threads would be on-boarded.
To achieve your desired value configure the following
Number of threads (users): 50 / 60
Ramp-up period: 30
Loop count: forever
Duration (seconds): 300
It is good practice to give some ramp up time.
Also Constant Throughput Timer works on minute level and your desired throughput should be
Target throughput (in minutes): 3000.0
Calculate Throughput based on: all active threads in current thread group
So now, in 1 minute, JMeter will try to send 3000 requests and in 5 minutes, request count will be more or less around 15000.
Here are a few recommendations to tackle tests like this:
Use Ultimate Thread Group to create the threads required to run your tests.
Increase the total number of threads to 150-200 - Depending on the response time of your requests, 50 threads may be busy and you are not able to scale beyond certain throughput.
Add throughput shaping timer under Ultimate thread group, to maintain the throughput of 50RPS for 5 minutes(300 Seconds).
The combination of Ultimate Thread Group and Throughput Shaping Timer will allow you to have granular control over your requests and RPS you want to achieve.
Set Ulitmate Thread Group and Throughput Shaping Timer as below.
Put all your requests below Throughput Shaping Timer and you should be able to achieve the expected load.
Try to use Stepping thread group. It will allow you to send 50 user per second upto 300 second.
Download jar from below link.
https://jmeter-plugins.org/wiki/SteppingThreadGroup/

How should I calculate Ramp-up time in Jmeter

There are many questions/answers available here to understand Ramp up time but I want to get something in detail for my test case.
Test Case : Expecting 1200 users per 5 minutes on the home page. So it will be like 5 users/second.
I have set following thread properties :
No. of Threads : 1200
Ramp-up Time - ? [I am not sure what to set]
Loop count - Forever
Scheduler - 300 Seconds[5 Minutes]
Can anyone please help me to set ramp up time for my test case? I am running the test on my local machine.
I want to check that how many users server can handle in 5 minutes. Our expectation is 1200 users.
As per you test case and duration settings, I think, you are making confusion with the Threads and Requests.
In short: You must use Ramp-up as 240 seconds for this scenario.
Let me describe you in details:
Ramp up is the time in which all the users arrive on your tested application server.
Requests are simulated by samplers but threads are the simulation of users.
Please note- The total number of requests are related to throughput, Whereas the number of active threads performing the same activity is related to concurrency.
From your requirements, I assume you want to measure the throughput which is related to the requests/second not the users per second. To achieve this, you can use a Constant Throughput Timer at your test plan level.
Constant Throughput timer allows you maintain throughput of your server (requests/sec). Here requests are samplers. Threads are users/clients which are requesting server using samplers.
You can achieve this by using both "Thread Group" or "Ultimate Thread Group".
As far as I know, it doesn't matter which type of Thread group you are using with Constant Throughput timer, at the end of the test in the results, you will get your desired Throughput which you mentioned in Constant Throughput Timer i.e. if you have mentioned 1200/min in Constant Throughput Timer with "Calculate Throughput based on" value as "All active threads" and there are 3 requests (samplers) in your thread group then JMeter will manage the requests in a way that it will generate only 6.6 requests/sec for each sampler i.e. 1200/min is divided among 3 requests, it doesn't matter whether you are using Ultimate Thread Group or the Thread Group; Throughput timer works in same way for all types of thread groups.
Now as per your requirement: (Using Thread Group):
No. of Threads : 1200
Ramp-up Time - 240 (Since you want 5 users per second, 1200/5= 240)
Loop count - Forever
Scheduler (Duration) - 780 Seconds [13 Minutes]
IMPORTANT:
Thread Group configurations will be the same which you have already mentioned. Number of threads will be the client load which you want to put(in you case it's 1200), duration : (240+300+240), loop : forever, ramp-up : 240 yes when you ramp up i.e. in the first minute generally you get more requests as threads are starting so it is normal behavior. To test your scenario run for exactly 5 minutes, you should test for 13 minutes. Exclude first 4 min and last 4 min of the test as that is warm up time for your test as well as server and last 4 min are warm down period.
Now as per your requirement: (Using Ultimate Thread Group):
Start Thread Count: 1200
Initial delay, sec: 0
Startup, sec: 240 (I assume you want 5 users come to your application for requesting expected samples per second)
Hold Load for: 300 sec (Since you required 5 minutes to test for 1200 users)
Shutdown Time, sec: 240
You can set just like this:
Don't get confuse the Thread number with the number of requests, each thread will create multiple requests for seconds in field Hold Load for.
Rampup is the speed at which users arrive on your application.
The number you put means that once it is reached all threads have been started.
The tiniest it is , the faster users arrive.
So nobody can answer that for you, you need to analyse your traffic.
Regarding the number of threads, 1200 threads might not be the good number, as 1200 users can navigate on application slowly or rapidly.
What you need is add a Constant Throughput Timer to control how much transactions per second you'll be reaching.
You should use the Ultimate Thread Group plugins available in Standard set.
To maintain concurrency the configuration should be like this:
Start Thread Count: 1200
Initial delay, sec: 0
Startup, sec: 60
Hold Load: 180
Shutdown Time, sec: 60
Ultimate Thread Group
Here all the 1200 threads will be generated and up within 60 sec of Startup time(Ramp up time) .Those 1200 threads will be active for next 180 sec, and after that, those threads will shut down within next 60 sec.
So overall duration of the test is 300 sec as you desire. Throughout the Hold Load time(180sec) the requests will be looped.
This ultimate thread group will give you more control over Threads.
Now if you want to control the rate of transactions per second or the number of samples to execute you can use Constant Throughput Timer. Constant Throughput Timer will let you control the flow of requests to be sent. The default "Thread Group" only control the way the users or threads will be generated.It doesn't control the rate of requests to be hit your application.So for this purpose, you could use "Constant Throughput Timer" to control your requests per second. For further detail, you could go through JMeter documentation.

Simultaneous SOAP Requests with JMeter

We have test-plan like below:
Test Plan
Thread Group
SOAP/XML-RPC Request 1
SOAP/XML-RPC Request 2
SOAP/XML-RPC Request 3
We have an issue when our service goes down on a certain day with a large load. We want to load test requests/responses per second, ranging from 500 to 10,000 requests over 20 mins to 1 hour.
Setting the thread value to 1200 for example only gives us roughly 60 per second. Any help to get this value up would be great folks.
ranging from 500 to 10,000 requests over 20 mins to 1 hour.
Do you mean 500 to 10,000 requests per second, or for example 10,000 requests over 30 mins which are a little over 5 requests på second?
I you are starting 1200 threads and not getting more than 60 requests per second it is probably not JMeter limiting the throughput. If you are sure the system can manage a higher troughput (thus it is not a service hardware problem) then I would check the network capacity between the load generating server and the service for bottlenecks.

Resources