I’m running K6 to load-test an external vendor’s API. I have been getting rather wild fluctuations in requests rate. We monitor the requests rate using statsd and new relic.
To check if the problem is on our end, I ran some tests against a mock server. I added a delay in this mock server’s request handling to simulate the response time. I found that as I increased the delay, the requests rate got more unstable.
For example, for one group of requests (CreateFoWithLatLong-AU), our target was to sustain 2000 iterations/min. However, we got:
- with a 1s delay, requests rate hovered between 1.91 - 1.97 k iters/min
- with a 3s delay, requests rate hovered between 1.78 - 1.89 k iters/min
I checked that:
- it was not due to insufficient CPU/memory
- there was still available VUs (*see CreateFoWithLatLong-AU - 203/300 VUs)
running (10m06.4s), 260/814 VUs, 87321 complete and 0 interrupted iterations CreateCustomer-AU [ 67% ] 06/10 VUs 10m06.4s/15m0s 5.00 iters/s CreateCustomer-SG [ 67% ] 11/20 VUs 10m06.4s/15m0s 11.00 iters/s CreateCustomer-TH [ 67% ] 4/7 VUs 10m06.4s/15m0s 3.33 iters/s CreateFoWithLatLong-AU [ 67% ] 203/300 VUs 10m06.4s/15m0s 33.33 iters/s CreateOrder-AU [ 67% ] 02/25 VUs 10m06.4s/15m0s 1.67 iters/s CreateOrder-SG [ 67% ] 06/50 VUs 10m06.4s/15m0s 3.67 iters/s CreateOrder-TH [ 67% ] 02/15 VUs 10m06.4s/15m0s 1.12 iters/s QueryCustomer-AU [ 67% ] 06/10 VUs 10m06.4s/15m0s 5.00 iters/s QueryCustomer-SG [ 67% ] 11/20 VUs 10m06.4s/15m0s 11.00 iters/s QueryCustomer-TH [ 67% ] 4/7 VUs 10m06.4s/15m0s 3.33 iters/s QueryVirtualPosition-AU [ 67% ] 005/300 VUs 10m06.4s/15m0s 61.10 iters/s QueryVirtualPosition500-AU [ 67% ] 01/50 VUs 10m06.4s/15m0s 5.00 iters/s
Would anyone have any insight into what is causing the unstable requests rate?