Reliable iteration frequency

I’m trying to do some load testing. I need to test at a rate of X requests per second. I presume that my VU iteration will take 1 second to execute. If it ends early, I sleep for the difference.
Within an iteration I issue an http post. Under load this can take more than one second to return, which means that my next iteration doesn’t begin 1 second later. This means I’m testing at < X requests per second.
I understand there is support for async default methods now. Does that mean that the VU will begin a second iteration while the first is still awaiting a reply, or will the VU resolve everything between iterations?
Maybe there’s a completely different mechanism I should be using to achieve reliably iteration frequency… suggestions?

EDIT: I’ve done some testing using an async default method. Unfortunately, it does seem that the VU waits for all pending promises to resolve before beginning a subsequent iteration.

Hi @dave.lawson.barbar

Welcome to the community forum :wave:

If I understand your scenario correctly, you are looking for the constant arrival rate executor, and open model. This executor will aim at a rate per timeUnit, and will start all the iterations needed. You will need to adjust the preAllocatedVUs to make sure in the case some iterations are slow, you have more VUs to launch all the iterations needed per second.

Have you already tried that executor? If it’s not working for your case, can you share the (sanitized) script and the test output? We can then have a look. Sometimes it’s the system under test that is the bottleneck, or in large tests, the load generator can also at play.

I hope this helps.

Cheers!