How to use the Constant Throughput Timer to specify a maximum of 4 concurrents users per second, during an hour

Axel picture Axel · Sep 24, 2014 · Viewed 19k times · Source

I need to create a load test in which there's a maximum of 4 concurrent users per second. Then I need to repeat this for an hour. Is there any way to achieve this in JMeter?

I have tried using this configuration:

  • Number of Threads: 4
  • Ramp-up period: 1
  • Loop count: Forever
  • Duration:3600

And to make sure that this run exactly for an hour I have also used a Runtime Controller with the same "3600" runtime value.

But these creates more concurrent users per second than what I need and besides it's also unlikely to have that many concurrent users as user usually take so time to think before they do something and this wasn't reflected in my configuration so also tried using Constant Throughput timer , but this only confused me more.

  • I'm sure I need to use the Constant Throughput Timer, but I don't have the faintest idea of how to do it in my case.
  • If a use the Constant Throughput Timer, how should I configure the Thread Properties (Number of threads, ramp-up period,loop count, schedule) ?
  • Do I really need to use a Runtime Controller, to ensure that the test plan runs exactly for an hour or is enough to specify a duration value of 3600?

Answer

Nachiket Kate picture Nachiket Kate · Sep 24, 2014

Constant throughput timer allows you maintain throughput of your sever. (req/sec) here requests are samplers. Threads are users/clients which are requesting server using samplers.

I hope this have cleared distinction between request and user i.e. sampler and thread.

Now Constant Throughput Timer works on sampler per minute basis. so for your requirement of 4 req per sec. it becomes 240 requests per minute.

and you want to maintain this throughput among all threads (if you have multiple thread groups) or among a single thread group if you have single thread group.

So JMeter engine will start all threads with given ramp-up but will allow only 4 samplers to executes at a given seconds i.e. only 4 request per second. Thus throughput is achieved among all threads and you can continue this for a specified time using either ways,

  1. Test duration
  2. Runtime controller

enter image description here

I hope it cleared your confusion and solved the issue.