Verify Fixed Rate Per Second

We have executed test with 200 VU per second for 10 Minutes. At the end of the test, we can see 119999 requests which is as per our expectation. Avg RPS shown on K6 console at the end of the test is 199.99.

Our requirements if to achieve close to 200 RPS. Its mandatory that per second it should be close to 200 RPS, not just an Average 200 RPS.

From Avg. 199.99 RPS, can we assume that per second it is ~199.99? Or what are the chances that sometimes per second it can be 202, sometimes 198, sometimes 190 like that… And therefore Average is 199.99 when test finishes ? +/- 5 is acceptable, but not more than that.

Is there a way to verify this ?

Hi,

be careful not to confuse “200 VUs per second” with “200 RPS”, as they’re not interchangeable. The amount of VUs running per second won’t necessarilly match RPS unless you ensure each iteration takes exactly 1s.

You can control requests-per-second in two ways:

  • with the run --rps option. This will limit the amount of requests globally for all VUs.
  • by dynamically sleeping on each iteration. See this blog article for how to achieve this.

HTH,

Ivan

2 Likes

Thanks a lot Ivan.
This will help me.

1 Like

Hey @vishal.lanke,

I have written a new blog post explaining the constant-arrival-rate executor to generate a constant request rate via the new scenarios API:

How to generate a constant request rate in k6 with the new scenarios API?

Good luck! :slight_smile:

1 Like

Looks very useful and will immediately use this in our fixed RPS tests.
Thanks a lot :slight_smile:

1 Like