Elapsed time of test in jmeter is not accurate - jmeter

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

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

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.

JMeter's run finish before the duration defined

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)

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

Resources