3

Does JMeter allow me to send a constant number of requests every second, instead of sequentially only when the request has finished? i.e. can I send request 2 after request 1 even if the request 1 is not done responding yet?

I am using Apache JMeter 5.2.1, I'd appreciate if anyone can give me guidance regarding this. The Constant Throughput Timer, seems to focus more on the throughput, however I'd like to simply send X req/s.

tsar2512
  • 2,826
  • 3
  • 33
  • 61

2 Answers2

4

Constant Throughput Timer is only capable of pausing JMeter threads in order to limit the number of requests per second to the given value.

So you must supply enough threads in the Thread Group to create more requests per second than you're trying to achieve and then limit the number of requests per second to the desired rate using Constant Throughput Timer.

So major limitations are:

  • Constant Throughput Timer can only slow down JMeter, it will not kick off extra threads
  • Constant Throughput Timer is precise enough on the "minute" level, if your test last less or you want to see immediate throughput changes you will need to play with ramp-up

So I would recommend going for one of the following approaches instead:

  1. Precise Throughput Timer (available since JMeter 4.0)
  2. Concurrency Thread Group and Throughput Shaping Timer combination, these guys provide the most flexible way to reach/maintain the desired throughput
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
3

The solution I eventually discovered was quite straight forward. If I decide that I need to make a total of 5000 requests, and I want to follow a paradigm of sending 2 requests every second regardless of whether a response has been received or not. I can simply use is to use the ramp up period.

"Ramp Up" - time taken to bring up all the threads

So if you want N requests every second, and want to send M total requests, you need to set up your ramp up period as M/N in my case 5000/2 = 2500. Additionally there is no need to have multiple iterations.

Ofcourse this can mean that you can increase the concurrent threads that the service is processing to a large number if the service is very slow, but that's what we want to test anyway.

tsar2512
  • 2,826
  • 3
  • 33
  • 61
  • More details: create `Thread Group` with `Number of Threads (users)"` = `M` and `Ramp-up period (seconds)` = `M/N`. – izogfif Mar 10 '23 at 16:13