So I have a thread group set to run for 30 seconds with simple HTTP sampler. Basically the test just sends a GET request to HTTP server for 30 seconds.
Is it possible to have the same test restart again once it has finished based on a predetermined amount of times. So say i want the test to rerun itself 5 times...
Option 1:
It is possible with Run Time Controller.
I assume you have set the 30 seconds duration in the Thread Group scheduler.
Change the test plan as given below.
Thread Group - loop count should be 5 (no of times should be repeated)
Add a Run time controller - seconds should be 30
Move all the samplers, other controllers (whatever you had under the Thread Group) under the Run time controller.
Now this setup will the run the test 5 times - for 30 seconds each time.
Option 2:
You can use a bat/sh file to rerun the same test again and again in a loop if you are running the test in Non-GUI mode.
Related
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
We are using the JMETER 5.2.1 tool from GUI, for our performance tests and this if my first time using it.
I would like to simulate a 24 hours run of our service, when I have 30,000 agents registered and each one send 10 queries a day (300,000 queries a day in total).
For that purpose, I have defined a Thread Group with the following configuration:
Number of Threads: 30,000
Ramp-up period: 40,000
Loop count: 10
Duration: 86,400 (24 hours)
For some reason the JMETER run finishes after 11 hours only!
I don't understand why because as you can see I have set the Duration to be 24 hours.
Any suggestions?
If you want your test to run for 24 hours - set Loop count at Thread Group level to Forever or to -1
If you want to execute 300 000 queries in 24 hours you need to introduce a rate limiting on JMeter side to execute 208.4 requests per minute, it can be done using i.e. Constant Throughput Timer
Don't use GUI to run JMeter tests as it might have very negative impact on test results, JMeter GUI is only for tests development and debugging, when it comes to test execution - go for command-line non-GUI mode
If Loop Count is not -1 or Forever, duration will be min(Duration, Loop Count * iteration duration) according to Scheduler Configuration in JMeter GUI. In other words you did 10 Loops faster then 24h. So you can run your loop Forever and limit it by 24h - you did more loops or you can try to add delay to your loop to match 10 loops in 24h. Third option is 3rd party plugin Constant throughput timer.
I would redesign your test to 10 Threads, 300 Ramp-up, Loop Forever, Duration 24h and tweak delay in Loop to match (24*60*60)/300000=0.288tps Since I understand threads as Concurrent connections at the same time (not 24h as you do)
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.
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.
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