Search code examples
performancejmeterperformance-testingload-testingjmeter-5.0

How can I make the Jmeter process exact number of samples within the given duration of time?


I have to exactly process 26.5K samples in an hour duration as part of soak test in non GUI mode. I have tried some approaches but I couldn't exactly process 26.5K users in an hour duration.

When 26.5K is equally divided for an hour, I could get 7.36 users per second

  1. So I tried giving 7 users, rampup-1sec, loopcount-infinite and duration-1hour, with constant throughput timer set to 420 req/sec but it ended up giving me total processed samples as 25118
  2. I even tried giving 8 users, rampup-1sec, loopcount-infinite and duration-1hour, with constant throughput timer set to 480 req/sec but it ended up giving me total processed samples as 28700

Would be helpful if I could get any other approach where I could exactly process 26.5K users or somewhere around it.


Solution

  • The most precise way seems to be Throughput Shaping Timer

    1. Make throughput a little bit higher, i.e. 7.37

      enter image description here

    2. Additionally put your Sampler under the Throughput Controller and set Total Throughput to be 26500 so you won't get higher samplers number:

      enter image description here