Search code examples
multithreadingjmeterpause

JMeter - Wait until the predefined time to start next thread


I configured Java based Selenium WebDriver test in Apache JMeter with the following setup:

  • Number of Threads (Users): 10
  • Ramp-up period (Second): 120
  • Loop Count: 1

I ticked the Delay Thread Creation until needed to save resources.

My expectation regarding the functionality:

I expected that if I have 10 users with 120 seconds ramp up time, then every user activity will start each other and the Jmeter will wait at least 12 seconds to start the next thread.

The issue is: The threads start sometimes within 11 seconds, sometimes 12 seconds. I don't know why does it happen because I would like to see the threads start after each other exactly in 12 seconds.

The question is

Are there any solution that to tell the JMeter to wait exactly 12 seconds for next thread start?

Here is the picture about started jobs with date time stamp:

enter image description here


Solution

  • I don't think you will be able to achieve this level of precision using ramp-up period approach of the normal Thread Group, a better idea would be going for the Ultimate Thread Group (can be installed using JMeter Plugins Manager) which allows absolute flexibility in terms of definition of ramp-up, ramp-down and time to hold the load.

    Example setup:

    enter image description here

    Example output:

    enter image description here

    In order to get only one execution of the "job" per each virtual user you can use Throughput Controller configured like:

    enter image description here