Jmeter: How to set up the stepping thread group? - jmeter

How to set up the stepping thread group? If my application gives average response time as 2sec for 100VU by using "ThreadGroup".

Actually, it depends of your performance test goals. Stepping Thread Group won't allow parameters smaller than 1 second. You have to deal with this limitation.
According to JMeter documentation:
Ramp-up needs to be long enough to avoid too large a work-load at the
start of a test, and short enough that the last threads start running
before the first ones finish (unless one wants that to happen).
Defining the ramp-up time is a very important step of your performance test. In your case, I recommend start with 1 thread per second using these parameters:
This group will start 100 threads;
First, wait for 0 seconds;
Then start 1 threads;
Next, add 1 threads every 1 seconds using ramp-up 0 seconds,
Then hold the load for 900 seconds.
You can choose to stop all threads at once then. It is up to you.
Why am I suggesting to run a test for almost 20 minutes? Because you are interested in the performance running with 100 threads and you want to maximize the number of samples with such load level. On the suggested setup, you'll have approximately 90% of your test time running with the ideal number of threads.
Once you have those numbers, you can experiment by starting more than 1 thread per second and decrease the overall ramp-up time. Always look at the resource usage (e.g. CPU utilization, memory available, etc.) to understand the system limits.

Related

Loadtesting:How to calculate total time for execution and ramp time for 10k rpm

i have to loadtest apis with 10k rpm,what should be the ramp up time and execution time.
10k rpm = 10k/60=166 req/sec i.e 166 concurrent users
but don't know to calculate exact ramptime time and execution time.
currently standard set is 60min execution and 15 min ramp up in the org
10k rpm = 10k/60=166 req/sec i.e 166 concurrent users
166 concurrent users don't necessarily mean 166 requests per second, moreover it will happen only if response time for each Sampler will be 1 second sharp.
If response time will be 2 seconds - you will have 83 requests per second
If response time will be 0.5 seconds - you will have 332 requests per second
So you need to supply sufficient amount of threads and add a relevant Timer like Constant Throughput Timer or Throughput Shaping Timer to slow down JMeter throughput to the desired value. The latter one can be connected with the Concurrency Thread Group so JMeter would be able to kick off extra threads if the current amount is not sufficient to conduct the required load.
And the system under test need to be able to respond fast enough because JMeter waits for the response from the previous request before starting a new one.
With regards to ramp-up, there are no exact numbers recommendations, the only approach you can follow is increasing the load gradually so you would be able to correlate the increasing load with increasing throughput, response time, number of errors and so on.
If you don't have better ideas you can go for the quote from the JMeter user manual:
The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
It completely depends on what exactly needs to be achieved
Things to consider:
Test execution duration and ramp up/ramp down of users, needs to evaluated based on the AUT(Application under Test) Real user utilization in Production.(Capture the number of users active at particular point of time in system)
Watch out for pattern of users entering/exiting the system.
Calculate User load/ RPM using Little's Law.
Some of the common test Types includes.
Baseline Test (Initial testing conducted with very minimal load to test the stability of the application)
Load Test (To evaluate applications performance under gradually increasing User load with expected concurrent number of users
Stress Test (Testing beyond normal conditions, increasing the user load until the Response time exceeds acceptable criteria. Usually done to find the breakpoint of the application, responsiveness of the application for higher volume traffic
Endurance Test ( To test for a longer durations, by applying varying loads.)

How to calculate inputs for performace and load testing using Jmeter

How to calculate inputs (virtual users, ram up period) for performance and load testing using Jmeter.
If you're doing Load testing - you are supposed to be checking your system behaviour against the anticipated load, it means that you should know the expected number of users from NFR or SLA
If you don't have any requirements - go for the stress testing, i.e. start with 1 user and gradually increase the load until response time starts increasing or errors start occurring (whatever comes the first)
With regards to the ramp-up period duration - there are no strict requirements, as per JMeter Documentation
The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
so if you don't have any better ideas - just go for the above recommendation.

In Jmeter how to find the response time for 1k/2k concurrent user, and also what should be Ram-Up time for 1k and 2k user

I have a requirement like API should be capable of handle 5k Concurrent user in 5 Sec.
How can i test this scenario in jmeter.
For 1k Concurrent user what should the RampUp time to be set in Jmeter.
5000 for 5 seconds is quite easy to achieve:
With normal Thread Group
With Concurrency Thread Group
With regards to the ramp-up, I can only give you:
a quote from JMeter documentation:
The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
and a piece of advice on ramp-up in general: if you're doing some form of a stress test it's a good idea to increase the load gradually, this way you will be able to correlate increasing load with the throughput and response time because running 5000 threads for 5 seconds will give you only a basic information on the response time for this workload and you won't be able to tell what is the maximum number of users/requests per second the application can support, when performance starts degrading, etc. So you could consider a load pattern like this:
and look at Response Times Over Time chart to see the relationship between the number of concurrent users and the application response time

What is the ideal ratio between No of threads and ramp-up period in Jmeter for REST API

I need to design a very basic Performance test for REST API.
no of concurrent users=40,
response time= less than 500ms
Usually what is ideal ratio between no of threads and ramp up period?
I read somewhere - Virtual users arrival rate should be something like 25-50 users per second. But I don't know its authenticity.
For my case shall I give ramp up period as 2 seconds?
Thanks in Advance!!!
The main purpose of the ramp-up period is that the load should be increased gradually (unless you're doing Spike Testing)
This way you will be able to correlate increasing load with increasing (hopefully) number of requests per second, response time, number of errors, etc. and if you will be kicking off threads without any ramp-up period - you will be able to state only that your application can (or cannot) support 40 concurrent users with (reasonable?) response time of 500 milliseconds.
As per JMeter documentation
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as needed.
So if you don't have better ideas you can go for the following setup:
40 seconds of ramp-up
couple of minutes to hold the load
optionally 40 seconds of ramp-down (you might be interested in decreasing the load gradually as well to see whether application goes back to normal when the load decreases)
More information: JMeter Ramp-Up - The Ultimate Guide
I'd not be overly concern about determining the ideal ramp-up time. Your goal, in general, should be to evaluate the application performance during the steady-state (after the ramp-up period and before the ramp-down period). Once you find a reasonable ramp-up period, use the following plugin (script) to discard such period(s), and then focus on analyzing the mentioned steady-state.

How to test 1 million users in Jmeter concurrently ? What should I use Number of threads & Ramp up period?

How to test 1 million users in Jmeter concurrently ? What should I use Number of threads & Ramp up period ?
I tried but I given Number of threads 1000000 and I have to give Ramp up period which don't allow to test in concurrent .
The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
Ramp-up needs to be long enough to avoid too large a work-load at the
start of a test, and short enough that the last threads start running
before the first ones finish (unless one wants that to happen).
Start with Ramp-up = number of threads and adjust up or down as
needed.
if you want all your threads starts simultaneously you can to set a ramp-up = 1 this means that jmeter will take 1 second to get all threads up and running! or 0 to starts them asap. but i hope that you have a good hardware to supports this.
http://jmeter.apache.org/usermanual/test_plan.html
Actually I would recommend choosing ramp-up so the load will increase gradually. For instance, your application is able to serve 500k users without any lag, from 500k to 700k response time grows, at 750k concurrent users it dies.
If you release all 1M users at once you won't get above information, all you will know is that your application doesn't support 1M users.
So I would recommend increasing loops count so existing users could continue work while new users are arriving so you will have gradually increasing load up to 1M of concurrent virtual users
Define desired test duration using "Scheduler" option in Thread Group (or using Runtime Controller)
Set "Loop Count" to Forever or put -1 there.
Set your ramp-up phase to be something between 20% and 50% of the overall test duration
Optionally it would be also good to implement "ramp-down" to see the system under test behavior when the load gets back to normal
Also keep in mind the following:
JMeter default settings are good enough for tests development and debugging, you will need to tweak them to achieve the maximum performance. Check out 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide for JMeter performance tuning recommendations
It is highly unlikely that you won't be able to simulate 1M of users using single machine so consider setting up Distributed JMeter architecture
1,000,000 threads would get you 1,000,000 Transactions Per Second only if the Response Times were under 1 second. You will need enough threads to include the system response time. 10,000,000 threads would allow for up to 10 second Response Times.
Others are correct, ramp up slowly to the full rate in order to have the time to view where issues lie.
I would use these settings to begin sizing the lab and slave count:
Number of Threads: 10,000,000
Ramp-Up Period: 1800 sec (30 mins)
Loop: Forever
Throughput Shaping Timer:
- Start RPS Row 1: 1
- End RPS Row 1: 1,000,000
- Duration Row 1: 1800 (same as rampup)
Start RPS Row 2: 1,000,000
End RPS Row 2: 1,000,000
Duration Row 2: 600 (10 minutes at full rate)
Start RPS Row 3: 1,000,000
End RPS Row 3: 1
Duration Row 3: 600 (gradually backing threads off to check for resource recovery)
Note what resource runs out first, adjust and repeat.

Resources