Ensure K6 completes 6k iterations in a min

Hello, I am trying to simulate a scenario where I want my application under test to process a specific number. requests in a min without failure.
For e.g. 6k requests in a min
I tried the below configuration
scenarios: {
contacts: {
executor: ‘per-vu-iterations’,
vus: 600,
iterations: 10,
maxDuration: ‘60s’,
},
},

However, the total number of iterations that the tests finish within 1min is around 4730. I am also trying to increase the number of VUs to ensure that the total iteration is reached but it just doesn’t. Can you help me here, am I getting something wrong here?

I have also tried
scenarios:
{
contacts:
{
executor: ‘shared-iterations’,
vus: 600,
iterations: 6000,
maxDuration: ‘60s’,
}
},

I still dont get 6k and this is just the tip of the iteration count that I want to aim, I also have a test to reach 55560 in a min! Can someone help pls??

Have you tried shared iterations? It might make more sense because you’re targetting a certain number of iterations in total and then you can adjust the VUs until you find your test device is capable of completing that many iterations in the duration you’ve set.

It might also help to see the k6 output if the target is not being reached.

Thank for responding!
If you see my post there is an option json with shared-iterations. I have tried per-vu iterations as well and they dont get beyond 4.7k. Also during the tests none of the api call fail all of them go through. I even tried to set the flag to discard the responses and removed all the code to process the response body and it barely increased it by a few. Is there any other way? May be k6 cloud?? or anything else?

Could you share your results so we can see the response times?

This time I got lucky but I need more iterations! :smiley:
Below is option json used:
scenarios: {
contacts: {
executor: ‘per-vu-iterations’,
vus: 350,
iterations: 18,
maxDuration: ‘60s’,
},
},

actualTimeToReadAContext.........: count=6220  min=309.32ms avg=1.59s   med=1.41s   max=5.88s    p(95)=3.56s    p(99)=4.52s   
 actualTimeToReadConfigMappings...: count=6220  min=310.27ms avg=1.6s    med=1.42s   max=6.1s     p(95)=3.55s    p(99)=4.44s   
 data_received....................: 668 MB 11 MB/s
 data_sent........................: 4.1 MB 65 kB/s
 dropped_iterations...............: 80     1.276411/s
 http_req_blocked.................: count=12441 min=0s       avg=24.85ms med=0s      max=1.35s    p(95)=1µs      p(99)=997.06ms
 http_req_connecting..............: count=12441 min=0s       avg=14.39ms med=0s      max=1.01s    p(95)=0s       p(99)=653.88ms
 http_req_duration................: count=12441 min=309.32ms avg=1.6s    med=1.41s   max=6.1s     p(95)=3.55s    p(99)=4.48s   
   { expected_response:true }.....: count=12441 min=309.32ms avg=1.6s    med=1.41s   max=6.1s     p(95)=3.55s    p(99)=4.48s   

✓ http_req_failed…: 0.00% ✓ 0 ✗ 12441
http_req_receiving…: count=12441 min=40µs avg=68.81ms med=40.02ms max=1.47s p(95)=188.37ms p(99)=316.8ms
http_req_sending…: count=12441 min=6µs avg=30.94µs med=17µs max=699µs p(95)=93µs p(99)=125µs
http_req_tls_handshaking…: count=12441 min=0s avg=3.15ms med=0s max=169.94ms p(95)=0s p(99)=137.65ms
http_req_waiting…: count=12441 min=281.77ms avg=1.53s med=1.35s max=6.04s p(95)=3.45s p(99)=4.35s
http_reqs…: 12441 198.497789/s
iteration_duration…: count=6222 min=243.66µs avg=3.25s med=3.15s max=9.8s p(95)=5.74s p(99)=7.32s
iterations…: 6220 99.240917/s
vus…: 30 min=0 max=350
vus_max…: 350 min=350 max=350

running (1m02.7s), 000/350 VUs, 6220 complete and 0 interrupted iterations
contacts ✓ [======================================] 350 VUs 1m0s 6220/6300 iters, 18 per VU


Below is the option json used:
scenarios:
{
contacts:
{
executor: ‘shared-iterations’,
vus: 600,
iterations: 6000,
maxDuration: ‘60s’,
}
},

 actualTimeToReadAContext.........: count=5164  min=303.95ms avg=3.65s   med=2.46s   max=24.7s    p(95)=11.96s   p(99)=14.62s  
 actualTimeToReadConfigMappings...: count=5164  min=305.83ms avg=3.59s   med=2.34s   max=21.98s   p(95)=12.08s   p(99)=15.28s  
 data_received....................: 555 MB 8.3 MB/s
 data_sent........................: 3.9 MB 58 kB/s
 dropped_iterations...............: 836    12.442219/s
 http_req_blocked.................: count=10329 min=0s       avg=55.24ms med=0s      max=1.77s    p(95)=343.44ms p(99)=1.48s   
 http_req_connecting..............: count=10329 min=0s       avg=49.98ms med=0s      max=1.68s    p(95)=257.74ms p(99)=1.39s   
 http_req_duration................: count=10329 min=303.95ms avg=3.62s   med=2.4s    max=24.7s    p(95)=12.03s   p(99)=15s     
   { expected_response:true }.....: count=10329 min=303.95ms avg=3.62s   med=2.4s    max=24.7s    p(95)=12.03s   p(99)=15s     

✓ http_req_failed…: 0.00% ✓ 0 ✗ 10329
http_req_receiving…: count=10329 min=132µs avg=82.96ms med=46.74ms max=873.91ms p(95)=213.42ms p(99)=351.19ms
http_req_sending…: count=10329 min=6µs avg=37.92µs med=26µs max=1.3ms p(95)=102µs p(99)=144µs
http_req_tls_handshaking…: count=10329 min=0s avg=4.36ms med=0s max=115ms p(95)=71.27ms p(99)=76.64ms
http_req_waiting…: count=10329 min=277.67ms avg=3.53s med=2.33s max=24.66s p(95)=11.88s p(99)=14.81s
http_reqs…: 10329 153.72689/s
iteration_duration…: count=5166 min=145.33µs avg=7.35s med=6.73s max=32.79s p(95)=16.5s p(99)=23.43s
iterations…: 5164 76.856004/s
vus…: 9 min=0 max=600
vus_max…: 600 min=600 max=600

running (1m07.2s), 000/600 VUs, 5164 complete and 0 interrupted iterations
contacts ✗ [===============================>------] 600 VUs 1m05.6s/1m0s 5164/6000 shared iters

1 Like

You may have seen this already but I only just found it. Maybe it’s of use to you in determining the cause of the dropped iterations?

It seems you may wish to convert to a rate-based test that uses the open model so that the test generates the tests regardless of how slow current tests are executing. See Open and closed models | Grafana k6 documentation

1 Like