How can I set up JMeter for periodic load test? - jmeter

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

Related

Increase threads gradually till given time

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

How to provide jmeter thread group , Ramp up peridod and Loop count?

I'm new to jmeter I have the following scenario. I want the jmeter to hit the given url, I have 13 such url in a csv file.
I want to hit the url at the rate of 2 requests per second for a given time period of 60 seconds.
In this case how should I specify my thread group, Ramp-up period and Loop count.
I understood the basic like 10 thread with 10 second rampup with a loop count of 1 will run 1 request per second for 10 user. But I'm not sure how to specify when we have 13 such urls.
Atleast any link for the given scenario is appreciated.
I understood the basic like 10 thread with 10 second rampup with a loop count of 1 will run 1 request per second for 10 user
not necessarily, JMeter waits for response from the previous Sampler prior to executing the next one, the configuration means that JMeter will start 1 user each second, it doesn't guarantee 1 request per second.
The easiest way of achieving X requests per second throughput is using Throughput Shaping Timer
Make sure to supply the sufficient number of Threads, i.e. if your application response time is 1000ms - 2 threads should be enough, if it's 2000 ms - you will need at least 2 threads, etc.
There is a special thread group: Concurrency Thread Group which can be connected to the Throughput Shaping Timer via Feedback Function so it will automatically kick off extra virtual users if the current amount will not be enough in order to conduct the required load.

How to create two requests with different delay time jmeter

i have the following scenario:
every 5 seconds a new user will be added and send ping
each user will ping every 5 minutes
each user will upload file every 30 minutes.
I believe the easiest way is going for Constant Throughput Timer like:
To get request running each 5 seconds set "Target Throughput" to 12 requests per minute (1 request each 5 seconds)
So you will have requests firing as per your requirement:
For request which needs to be executed once per 5 minutes do the same but set "Target Throughput" to 0.2
See How to use JMeter's Constant Throughput Timer for more information.
You may be also interested in Throughput Shaping Timer which is more precise and advanced version.
For a new user every 5 seconds use Ramp up period 5 times the number of threads.
Add to your Thread Group a Loop Controller with 6 Loop count, inside put ping request,
Add as a child to your ping request a Constant Timer with 300000 milliseconds (5 minutes * 60 seconds * 1000 milliseconds).
timers are processed before each sampler in the scope in which they are found
After Loop Controller add upload file sampler
In Thread Group You can define Scheduler (checkbox) with Duration you want the test to run.
When using the scheduler, JMeter runs the thread group until either the number of loops is reached or the duration/end-time is reached - whichever occurs first.

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

Loadtesting in burst mode in Jmeter

I am running my load test for a duration of 1 hour,in between the test I want a scenario to run for a duration of 1 minutes at regular interval of 15 minutes.
In jmeter,currently I am able to simulate for all the others scenarios except for the burst mode.
How do I keep the delay for 15 minutes and trigger the request for duration of 1 min?
How do I achieve the TPS for the burst? Currently I have to manually trigger jmeter script.
I would suggest doing the following:
Add a separate Thread Group.
Configure ramp-up and thread count as required.
Add a Constant Timer, set Thread Delay to 900 000 (15 minutes = 900 seconds, 1 second = 1000 ms)
Add a Runtime Controller, set Runtime to 60.
Add a Loop Controller, set Loop Count to Forever.
Place your burst test logic under the Loop Controller.
If you need to define requests per second rate during spikes use Constant Throughput Timer
I came here since I had the same issue or similar issue of "simulating" burst like request during the load test. I tried to follow the accepted answer but didn't get it to work (perhaps I misunderstood some steps), anyway; I based my solution in #esteveavi comment Loadtesting in burst mode in Jmeter from the original post above. And ended up using JMeter's "Ultimate Threat-Group" plugin with something like the following test plan set up:

Resources