Pause a test 2 mins on every 1000 users reached in Jmeter - jmeter

We are running 25k users for load test.
Dev team asks to wait atleast 2 mins on every 1000 users boarded.. Is it possible by IfController by taking count of modules by 1000 and make it pause for 2 mins..?

You can use Ultimate Thread Group and set Delay of 2 minutes by separating every 10 K to a row with Initial delay
separate ramp-up time, shutdown time, flight time for each shedule record
Example:

Related

What is the difference between Ramp up time and Synchronization timer

Example:
`1. No of Threads = 100
Ramp-up time = 20, means every 1 second = 5 requests will be processed.
Loop Count =1
In the same time:
If i will do like below
No of Threads = 100
Ramp-up time = 1,
Loop Count =1`
And put Synchronization Timer : No of Simulated user to group = 5.
In this case as well, J meter process 5 requests at one time.
So what is the different logic between the above 2 concepts.
Considering case 1 where the
Number of threads = 100, Ramp-up time = 20 and loop count =1.
This means that for every one sec 5 threads will be induced.
Depending on the time taken for the response the test will run for at least 20 sec or more.
Considering case 2 where the
Number of threads = 100, Ramp-up=1, loop count=1 and
Adding Synchronization Timer with No of Simulated user to group = 5
A batch of 5 users will be added at once.
Both the tests don't take the same amount of time to complete.
In case 1, 5 users are distributed over a period of one sec. i.e. per 0.2 sec one user is added.
In case 2, 5 users are added to the active thread in one go.
To know more about Synchronizing Timer
To best understand the difference between the 2 use cases, increase the number of threads to 200 while keeping the remaining parameters as is. Then the difference can be noticed easily.
means every 1 second = 5 requests will be processed. Loop Count =1 - this is wrong, JMeter will start 5 threads each second, the processing time depends on application response time. The concurrency (number of requests at the same moment of time) is not guaranteed
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.
See JMeter Ramp-Up - The Ultimate Guide article for more comprehensive explanation.
Synchronizing Timer guarantees that 5 requests will be executed at the same moment so in your 2nd scenario it would be sending requests in "batches" of 5. Normally people go for Synchronizing Timer to do some form of Spike Testing

What is the ramp-up period in jmeter?

I ran a test plan with 5 users for a total of 20 seconds and what I am not able to understand is what ramp-up period is in actual. Does it means that each user will get 4 seconds or 20 seconds will be used in total for 5 users?
If case 1 is true(4 second for each user) then the first thread should be completed in 4 seconds but it took 6 seconds to complete it and still the result is passed and next user gets executed? This gets much confusing. I need to clear my doubt as I am not able to find any answers from all the inputs that are available here
As per JMeter Thread Group Documentation:
Ramp-up Period
How long JMeter should take to get all the threads started. If there are 10 threads and a ramp-up time of 100 seconds, then each thread will begin 10 seconds after the previous thread started, for a total time of 100 seconds to get the test fully up to speed.
You have 5 users
if you set ramp-up period to 0 - all 5 users will start at once
if you set ramp-up period to 5 - JMeter will start with 1 user and will add an extra 1 user each second
if you set ramp-up period to 10 - JMeter will start with 1 user and will add an extra 1 user each 2 seconds
etc.
Once user is started it starts executing Samplers upside down (or according to Logic Controllers) when there are no more samplers to execute or loops to iterate - the thread is being shut down.
Check out JMeter Ramp-Up - The Ultimate Guide article for more information on configuring users arrival rate.
You might also be interested in Ultimate Thread Group which makes workload definition easier, moreover you will have a chart representing anticipated load. You can install Ultimate Thread Group using JMeter Plugins Manager
If you want threads not to effect test expected time then use instead Thread group's Loop Count as the number of repeatitions you need.
If you want/must use threads calculate ramp period time as
(test expected time + 1 second) * number of threads

Whats the difference in JMeter thread group between 50 threads 5 second ramp up and ...?

Whats the difference in JMeter between:
(a) 50 threads 5 second ramp up and 1 loop count
(b) 10 threads 1 second ramp up and 5 loop count
For me (a) and (b) seem to be the same thing, 10 threads will be instantiated every second for a total of 5 seconds.
Am I missing something here?
ramp-up period doesn't effect total number of threads. see user manual:
The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen
So both scenarios will be executed 50 times, the difference is the order of the threads. In your case let's assume each thread takes ~5 minutes
Scenario a (without encountering any bottleneck) will take ~5 minutes (+5 seconds ramp up)
While Scenario b will take approximately 5 times more because each loop will start after threads ends. 5 minutes will take for each loop - ~25 minutes (+1 second ramp up)
Also you can have limitation on your server that doesn't allow 50 threads executing in 5 seconds same operation so Scenario a will be impossible to execute.

How to add 10 threads every 1 minute?

I want to add 10 threads every 1 minute in my load testing.I put 300 seconds in my duration equivalent to 5 minutes. So the total threads are 50 after the test. Heres the config in the thread group. I am using JMeter GUI.
Threads: 10
Ramp up: 1
Duration: 300 seconds
Ramp up is the time in which all the users arrive on your tested application server.
In Thread Group 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).
Thread Group also provides a scheduler. Click the checkbox at the bottom of the Thread Group panel to enable/disable extra fields in which you can enter the duration of test, the startup delay, the start and end times of the run. You can configure Duration (seconds) and Startup Delay (seconds) to control the duration of each thread group and the after how much seconds it starts. When the test is started, JMeter will wait Startup Delay (seconds) before starting the Threads of the Thread Group and run for the configured Duration (seconds) time. Note those 2 options override the Start time and End time.
Set your Thread Group like this:
No. of Threads: 50
Ramp-up Time - 300sec (Since you want 10 users per min, 10*60*5= 300)
Loop count - Forever
Scheduler (Duration) - 900 Seconds [Total 15 Minutes: 5 mins for users ramping up time, 5 mins for your test and 5 mins ramping down time]
To know the details, you can also see this thread on How should I calculate Ramp-up time in Jmeter.

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