Increase threads gradually till given time - jmeter

We have below scenario where we need to increase the load gradually till given time.
- 30 users per API (currently only one API)
- Add 10 user every second for the ramp-up.
- 30-second wait between iterations
- Run the test for 60 minutes
- Roughly 24,000 calls per hour (not sure on this count)
Not sure how to do this.

30 users per API - configurable in Thread Group, for 1 API you will need 30 users
Add 10 user every second for the ramp-up - you need to set ramp-up period of 3 seconds in the Thread Group
30-second wait between iterations - Add Flow Control Action sampler and configure it to pause for 30000 milliseconds:
Run the test for 60 minutes - find the relevant Thread Group configuration below:
Roughly 24,000 calls per hour - it depends on your application response time, if it will be too high - you can limit it using Constant Throughput Timer

Related

I have a question regarding Jmeter thread group section

In Jmeter Thread group section, if I am adding 3000 threads with a ramp-up time of 15000 secs, does that mean all 3000 users will be active till 15000 secs ends?
How many simultaneous users are on my website in that case?
Every 5 seconds a thread will be created until end of 15000 secs.
Simultaneous users depends on test plan execution, if only 1 loop and 1 request that finished in less than 5 seconds then you will have only 1 simultaneous user.
If loop is inifinite you will have 3000 simultaneous users after 15000 secs
It mainly depends
on the number of iterations you define in the Thread Group
number of Samplers
your application response time
Your "3000 threads with a ramp up time of 15000 secs" configuration means that JMeter starts a new thread (virtual user) each 5 seconds.
Once started thread starts executing Samplers upside down (or according to the Logic Controllers)
When there are no more Samplers to execute and loops to iterate - the sampler gets shut down
So depending on the number of loops and response time you can have from 0 to 3000 users.
In order to check the actual concurrency you can use i.e. Active Threads Over Time and Server Hits Per Second plugins (they can be installed using JMeter Plugins Manager)
Yes. Time taken per user to activate = Ramp up time / No. of threads, in your case 15000/3000 = 5 sec per user.
as you can see 1 user will be added per 5 second and eventually you will have all 3000 users active by the end of 15000 sec, given your first or any other user does not complete iteration and shut itself before last user gets chance to start ( last user starts at 15000th sec here)
Note : To achieve a load of 3000 users by the end of 15000sec, you can set LoopCount to "infinite" but this will cause increase in number of total samplers and you may end up iterating your script way more than 3000 times.

Elapsed time of test in jmeter is not accurate

I am curious why the elapsed time of the current running test in JMeter is not accurate?
I set my thread group to the following specs:
Number of threads - 2;
Ramp-up period - 1;
Loop count - 60
I suppose that means that every second 2 users will perform some actions and the step will be repeated 60 times. Which means it will take 60 seconds to complete the test.
But the elapsed time of the current running test shows 25 seconds. Why it's less than 60 seconds? How can it be that my test is completed so fast?
JMeter acts as follows:
Each thread (virtual user) starts executing Samplers upside down (or according to the logic controllers) as fast as it can
When there are no more Samplers to execute (or loops to iterate) the Thread is being shut down
Your configuration means that 2 users will execute samplers 60 times, the elapsed time depends on:
how fast JMeter can send the requests
how fast your application can respond
If you're looking for a configuration where 2 threads are executing samplers for 60 seconds - amend your Thread Group setup as follows:
If you have troubles in setting up the workload model it might be easier to use a Custom Thread Group for example Ultimate Thread Group which provides extreme flexibility when it comes to ramp-up, ramp-down, time to hold the load definition, etc.
These "custom thread groups" can be installed using JMeter Plugins Manager
The requests inside your test will be executed 60 times using 2 concurrent users
For example if you have 1 request which takes 1 second it will take around 30 seconds:
Total 60 requests * 1 seconds (time per request) / 2 (concurrent) users = 30 seconds

How to set 1000 threads which needs to completed in 1 minute(60 sec) by using stepping thread group in jmeter?

I am having a requirement to perform a load testing for api's with 1000 request per minute. i have setup a stepping thread group as displayed below :
In above image you can see that i have configured the parameters as 20 threads per second ,so it will take 50 seconds to reach 1000 threads. but still graph shows 2 min and 31 sec to completed the 1000 request.so please help me to set it.
Please help me to configure it properly , my exact requirement is as displayed below :
1) 1000 threads
2) In 1 minute it needs to be completed.
Change stepping thread group settings to hold 60 seconds 1000 threads:
1000 threads (virtual users) will produce 1000 requests in one minute only under specific condition: response time must be 16.6 milliseconds.
If response time will be higher - JMeter will execute less requests
If response time will be lower - JMeter will execute more requests
If you want JMeter to conduct the load at rate of 1000 requests per minute it's better to consider Concurrency Thread Group and Throughput Shaping Timer combination
Throughput Shaping Timer configuration:
Concurrency Thread Group configuration:

Loop count and Ramp Up period in JMeter

I have created a set and just confused with the Loop Count and Ramp Up period.
I have a test set with the following parameters.
Threads = 30
Ramp Up Period = 30
Loop Count = 100
As per the page on
quora.
I suppose:
a) If Loop count is Zero, then each of the 30 threads will be starting every second. As per the shared the web page, I guess 30/30 * 100 ie 100 threads/requests will be hitting the server every second. Please correct me if I am wrong.
b) As per the above parameters, there will be a total of 30 * 100 threads/requests. Does this mean all the 3000 threads/requests will be sent within 30 seconds [ Ramp Up period ]
Assuming you have 30 users and 30 seconds ramp-up
JMeter will start each virtual user each second
Each virtual user will start executing samplers upside down (or according to the logic controllers, if any) as fast as it can (if you don't use timers) so the delivered load can be either more or less than 30 requests/second, it depends on how fast JMeter is executing requests and on your application response time as JMeter will wait for response from previous sampler before starting new one
When virtual user finishes executing all the samplers defined in test plan it will start over and do point 2 for 99 more iterations
When virtual user won't have more samplers to execute and loops to iterate it will shut down
A couple of tips:
You can use Server Hits Per Second listener to see how many requests per second you are actually making given your test plan configuration
You can control the number of requests per second via Constant Throughput Timer
Consider upgrading to JMeter 3.2 as newer JMeter versions normally contain new features, performance improvements and bug fixes
according to jmeter manual ramp up is:
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.
So if your goal is to reach 3000 request within 30 seconds the above wont do, it might take more than that depending on how much it takes to finish the requests you are sending.
If you are looking for Throughput you can add an aggregate report listener which calculates the throughput for you and depending on the results you can configure your thread properties to reach your goal.
Reference :
Jmeter user manual

How can I set up JMeter for periodic load test?

I am struggling to simulate 10 users per second doing GET requests for 20 seconds in every 40 seconds and this test should run for 2 minutes.
I used a Thread group where I created 10 threads (users) and ramp-up time 1 second, so the 10 threads are going to be loaded in a second and the loop count is 1.
The following elements were added to this thread group.
Then I added a Constant Throughput Timer with the set up of 60, which means that approximately 10 GET request will happen per second.
Added an HTTP request Sampler for the GET request.
Added a Runtime Controller with the set up of 20 seconds.
Added a Constant Timer with the set up of 40 seconds.
This is just not working out. any help much appreciated.
I checked many websites already but could not find anything which would deal with this 'periodic load testing intervals'.
As per Cagy79 pointed out, here is a similar question
which actually i have checked already before but had no luck. Just now I was able to make it work:
Create a Thread Group with the set up of 200 users, 20 seconds ramp-up, loop count 1 (so 10 user will make GET requests per second for 20 seconds)
Create a Constant Timer with the set up of 40000 milliseconds (so the above burst will run at regular interval of 40 seconds)
Create a Loop Controller with the set up of Loop Count 2 (so our the burst will run twice, at 40th seconds and 80th seconds only. We do not want it to start to run at 120 seconds)
Create the HTTP GET request under (nested) the Loop Controller

Resources