1

Running JMeter version 5.4.1

I have the following setup for a JMeter thread group:

  • Number of Threads: 300

  • Ramp-up Period: 300 seconds

  • Loop count: infinite

  • Specify Thread Life time: Duration 600 seconds, startup delay: 0

Thread group is set to continue after a sample error.

So with the above setup, I'm expecting the test to spin up 1 thread per second, when it reaches 300(5min) seconds, it will have a full 300 threads running. Each thread should be running for 600 seconds(10min) before stopping. I'm expecting the total run time to be 900 seconds (Last thread starts at minute 5 + 10 min run time = 15min).

But the actual behavior is different and I can't figure out why.

Actual behavior:

--300 threads spin up after 300 seconds, 1 thread per second. Cool this is what I'm expecting.

--at 600 second mark, the first thread start to die. Cool so far so good

--at 12min which is 720 seconds, ALL threads have died off, and the test is complete... umm.. what happened here? I was expecting a full 300 seconds wind down time, not 120 seconds?

As a result, the full test finished at 720 seconds (12min), instead of the full 900 seconds (15min).

Can anyone explain to me what is going on here?

Masud Jahan
  • 3,418
  • 2
  • 22
  • 35
JaySym
  • 63
  • 1
  • 8

3 Answers3

2

You have to configure your test duration accordingly.

In your case, the test finishes at 600 seconds. The last 120 seconds was the ramp-down time of those active threads. You can observe it through Active Threads Over Time Listener.

Your total test duration would be like warm-up period + hold load activity + warm-down period. i.e (300+600+300)= 1200 seconds or 20 mins.

300 threads will be active in 300 seconds, then all the 300 threads will hit requests to the server for 600 seconds, and then those 300 threads will be down in the next 300 seconds.

You can also use Ultimate Thread Group like this as well for a better understanding of your test, where the warm-down period is used as 120 seconds, so the total duration of the test is (5+10+2)=17 mins or 1020 seconds.

enter image description here

Masud Jahan
  • 3,418
  • 2
  • 22
  • 35
  • I see, I was under the impression that the thread duration of 600 seconds did not include the ramp up time of the thread, but it looks like the ramp up time is also included in the thread duration. Thanks. – JaySym Mar 23 '23 at 18:42
0

It isn't exact and specify duration of the test plus finishing iteartion

This denotes the total duration of the test. One disadvantage to run the test by specifying the duration value is that the test stops immediately when the test duration is completed; without completing the loop (iteration) due to which you could see some differences in transaction count.

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • the test loops themselves are very fast, less than a second each. But it is set to infinitely loop. So the actual test duration here shouldn't matter, at least it shouldn't contribute to a 3 minute difference in run time. – JaySym Mar 12 '21 at 20:17
  • @JaySym you can't rely on exact timing using this feature – Ori Marko Mar 12 '21 at 22:30
0

You specified test duration of 600 seconds, why do you expect your test to last longer?

Once 600 seconds are passed JMeter will ask threads to stop and the time required for all of them to stop mainly depends on the nature of the test, request/response size, etc. In ideal conditions the test should be stopped immediately.

So if you want your test to run 15 minutes - set duration to 900 seconds.

If you want the gradual ramp-down - consider adding a Timer to your Test plan or switch to a custom thread group which allows precise control over threads, see How to Ramp Down in JMeter article for more details.

Coming back to threads termination taking 2 minutes, it should not be the case, make sure to run your JMeter test in command-line non-GUI mode and follow other JMeter Best Practices

Dmitri T
  • 159,985
  • 5
  • 83
  • 133