How to use multiple scenarios in jmeter - jmeter

I have to test ramping up 1 user every minute for 10 minutes and then then ramping up 20 users ever minutes for next 10 minutes with jmeter. I tried to search on internet, seems like I need to use ultimate thread? If so can someone please give me an example of above scenario?

You can use multiple regular thread groups and in Test Plan,you can select Run thread Group consecutively.

Ultimate Thread plugin allows fine grained control of user threads. It will certainly achieve the concurrency pattern you're looking for. You can also start a thread group delayed with just out-of-the-box Jmeter though:
Use 2 thread groups, and set the required ramp up rates for each thread group. Since you need the second thread group to kick in 10 minutes after the test starts, add a startup delay of 600 seconds.
The relevant jmeter documentation is in Section 4.1 here:
Version 1.9 introduces a test run scheduler. Click the checkbox at the bottom of the Thread Group panel to reveal extra fields in which you can enter the start and end times of the run. When the test is started, JMeter will wait if necessary until the start-time has been reached. At the end of each cycle, JMeter checks if the end-time has been reached, and if so, the run is stopped, otherwise the test is allowed to continue until the iteration limit is reached.
Alternatively, one can use the relative delay and duration fields. Note that delay overrides start-time, and duration over-rides end-time.

It is possible to do with 1 ultimate thread group.
Your setup should be as given below. You did not mention the test duration. I assumed it as 3600 seconds.
1st Row : We will have 10 threads in 600 seconds by starting a thread every min.
2nd Row: We will have additional 200 threads (ignoring the first 10 threads), in the next 600 seconds by starting 20 threads every 1 min.
We need a wait for 600 seconds in the second row which is update in Initial Delay field for the first row to complete.

Related

duration in jmeter thread group

what is the meaning of the duration in jmeter thread group.
I found this is official document saying that is end time while the startup delay is the start time.
But is it the end time since we start executing the test? or since the thread is created?
When I set the 50 threads and duration 1s, the first timestamp in the output file is 1607391972250 (2020-12-08 09:46:12.25), the thread-50 only send HTTP Request 1 in timestamp 1607391973232 (2020-12-08 09:46:13.232). So it cannot be the end time since each thread is created
But when I set 1000 threads, the timestamp of the last several thread will exceed 1s than the timestamp of first thread's first request. it cannot be the end time since the we start executing the test
So what is the real meaning of the duration?
Duration is neither the start time nor the end time but the timespan between the two.
If your total duration is 1 second and your ramp up time is 1 second it might lead to a bit confusion since some of the threads have only just started when the whole test is already over. The duration starts counting when you either hit the "play button" in the GUI or start the test via command line.
Startup delay will mostly make sense if you have several thread groups inside your test plan and want some part of the virtual users to start at a later point for either logical reasons (e.g. thread group A generates forum posts and group B starts searching those forum posts after 1 minute) or for some kind of load shaping (might be achievable within one thread group though). This is relative to the test start.
Anyway JMeter is a tool mostly used for load and performance testing. In this type of testing you will usually have the tests run for minutes or hours. So from my perspective your question is mostly theoretical unless you want to achieve something very specific which you did not further elaborate.
As per Thread Group documentation:
Specify Thread lifetime If selected, confines Thread operation time to the given bounds
Duration (seconds) If the scheduler checkbox is selected, one can choose a relative end time. JMeter will use this to calculate the End Time.
So "Duration" limits the maximum duration of a given single thread, JMeter starts threads within the bounds of the Ramp-Up period.
In your case you have Ramp-Up time set to 1 second and Duration set to 1 second, it means that JMeter will start 50 threads in 1 second (so the last one will be started in 1 second after test start) and then the last thread will be terminated in another 1 second so its total lifetime plus the time required to execute the first sampler if its response time is more than 1 second
You may find Custom Thread Groups easier to use, all of them provide easy configurable visual way of defining the workload, you can install them using JMeter Plugins Manager

Is there any way in jmeter where i can add delay time between half requests in Jmeter?

I want to send 100 users in 5 seconds and my loop count is 1, but i want to add delay time of 10 seconds after 50 users then remaining 50 users will hit.
Please help me with some suggestions.
You Can use Stepping Thread Group to perform the action required. By Configuring the steps according to your requirement.
Your requirements are mutually exclusive, first you're talking about 5 seconds and then you need 10 seconds delay which brings us to at least 15 seconds plus your application response time.
The easiest option would be going for Concurrency Thread Group or Ultimate Thread Group where you can easily set up whatever workload you want.
Alternatively you can go for the:
Flow Control Action sampler - to introduce the 10-seconds delay
Synchronizing Timer - to act as a "rendezvous" point for the virtual users

How to configure Threads in Jmeter

How to setup delay in jmeter each user Thread Group.
I am trying to run my script Thread group (users) 10,20,30 and 40 and having a delay of 2 min each in them.
How to setup these things in jmeter?
If you want to test your application with 10 users and each user will come after 2 minute delay than pass ramp up as 1200 sec in thread group
The best controller is "jp#gc - Stepping Thread Group". Why it's the best one is, If you use JMeter "Thread Group", we need to change the "Ramp-Up Period" depending on the Threads.
10 User, wee need "Ramp-Up Period" as 20 (1 users for 2 seconds =20/10) to meet you requirements .
20 user, wee need "Ramp-Up Period" as 40 (1 users for 2 seconds =40/20) to meet you requirements .
........etc
If you use "jp#gc - Stepping Thread Group" , we no need to change the "Ramp-Up Period" depending on Thread count.
Just mention "Next, add" :1 threads every 2 seconds,"jp#gc - Stepping Thread Group" will take care Ramp-up irrespective of Thread Count.
You can use Stepping Thread to make your load testing, which helps you to simulate as an apllication used in real time
Just add Constant Timer to your thread group. That's how it is described: "If you want to have each thread pause for the same amount of time between requests, use this timer.".
And if you want to reproduce a special case when you run 30 threads then make a break for 2 mins before next 40 users, then enable "Run thread groups consecutively" option in your test plan settings (top-level element) and add thread with only constant timer between them.
For example if you want to test 40 uesr test with rampup of 10 users.
Each user will take 2 min to rampup. We can use following configuration.

JMeter: delay between each thread request a sampler

I am working on stress test, but my first sampler floods server with tons of requests with very little amount of time, so I want to make a delay between each thread using request.
Test structure:
Thread1 - Sampler1 (for example: access login form)
Delay (custom seconds)
Thread2 - Sampler1 (for example: access login form)
Delay (custom seconds)
ThreadN - Sampler1 (for example: access login form)
Delay (custom seconds)
Thread1 - Sampler2
Delay (custom seconds)
Thread2 - Sampler2
Delay (custom seconds)
<...>
Synchronizing Timer
All threads realeased with final sampler (this part works)
I tried to put timers as samplers parents or childs. Probably I am missing something, because non of the timers are working for me.
I've found similar problem solutions, but non of the worked for me:
JMeter - sharing a delay between requests across multiple ThreadGroups
Delays for each thread in Ultimate Thread Group
I would suggest using the stepping thread group via http://jmeter-plugins.org/wiki/SteppingThreadGroup/.
In the 'thread scheduling parameters' section, you'll note you're able to specify the maximum number of threads to run at peak, but you're also also to slowly instantiate threads as you need them.
Very plainly, the setup below says "When I run this test, I'm eventually going to want 100 threads, but when I first start the test, wait 15 seconds, then only start 10 threads. Then add another 10 threads every 120 seconds. Once we reach max threads, keep working for 180 seconds, then slowly peel off 5 threads every 15 seconds.
This should meet your need.
As per your Test Plan description, you can use 1 of the timers mentioned below:
Gaussian Random Timer
Constant Timer
Hope this will help..
Constant Timer would be best option as per your mentioned requirement.
You can use 'Ultimate Thread Group' instead of regular Thread Group. There is 'Initial Delay' in ultimate thread group which will help you to achieve your requirement.

Using JMeter for availability testing

My goal is to fire a thread every 15 minutes to a website with some actions (e.g. intro, choose_language, search_term). Where I will assert using a Response Assertion to check whether the site is available.
Is it possible to schedule JMeter like this from within JMeter itself? Is it possible using any of the timers? I am thinking of starting my script using the Windows Scheduler as a plan B.
I thought I would be able to set it with the Ramp-Up in the Thread Group. My thought was:
Number of Threads (users): 1
Ramp-Up Period (in seconds): 60
that this would mean that 1 user would be started every 60 seconds, but this seems not to be true.
To do what you want,
You can use one user, and within a debug sampler at end of (login, intro, search) add a timer that last 15 minutes.
You misunderstand rampup, with what you set it's useless as there is only 1 user. With 15 users, it means, start each of these 15 users within 60 minutes then once started it is not used anymore

Resources