0

I have situation where I need to make constant request for a certain period of time, say 5 requests in every 1 second for 30 seconds. I used the constant-arrival-rate to achieve this but I don’t see the expectations are met while using it. I am expecting 150 requests to be made when the test run finishes but I see less than 150 requests are made. I tried increasing the VUs and still the total requests made does not reach upto 150. Can someone help me out on this? Am I missing something?

scenarios: {
constant_request_rate: {
  executor: 'constant-arrival-rate',
  rate: 5,
  timeUnit: '1s', // 5 iterations per second, i.e. 5 RPS
  duration: '30s',
  preAllocatedVUs: 1, // how large the initial pool of VUs would be
  maxVUs: 10, // if the preAllocatedVUs are not enough, we can initialize more
}}
Joz
  • 35
  • 4
  • How far off are you? If you get 149 or 148 requests, that would be okay. 30 is not. I see your maxVUs is set to 10, which is not a lot, especially if your server is slow to respond. if that's the problem, then you should see a warning in the output "reached max VU, cannot create more". Also, how do you come up with 1000 rps in your comment? You have defined 5 rps. – knittl Aug 12 '22 at 16:36
  • @knittl Thanks for the reply. 1000 rps in the comment was a typo, my bad. I got confused with the Max VUs and it seems like the it all depends upmn the number of VUs defined. Got it cleared. Thanks – Joz Aug 25 '22 at 10:22

1 Answers1

0

Your given example configurations defines a maximum of 10 VUs (virtual users). Depending on the characteristics of your server under test, this might not be enough. You need to allow enough VUs to be started/spawned which will then concurrently execute the requests.

If the maxVUs setting is too low you will see get a warning in the output of the script:

level=warning msg="Insufficient VUs, reached 10 active VUs and cannot initialize more" executor=constant-arrival-rate scenario=constant_request_rate

knittl
  • 246,190
  • 53
  • 318
  • 364