Axel
Axel

Reputation: 1674

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

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:

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.

Upvotes: 13

Views: 23456

Answers (1)

Nachiket Kate
Nachiket Kate

Reputation: 8571

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.

Upvotes: 21

Related Questions