Batch requests Vs regular requests

If we send a batch of requests, then does K6 wait for all of them to complete? If I am starting performance test for a new service, then it is better to send batch requests or ungrouped requests to get baseline performance numbers?

I am unsure which way is the right way

Hi @aakash.gupta,
yes, the k6 batch will wait for all of them to complete.

it is better to send batch requests or ungrouped requests to get baseline performance numbers?

By ungrouped, do you mean several HTTP calls invoked in the iteration function? If yes, then it’s important to see the difference with a batch request where the item requests are processed in parallel, this is not the same for a sequential series of HTTP calls where the iteration code fires a new request only when the previous is completed.

What is the optimal solution depends on the test and the case you’re trying to replicate and what you would represent with your baseline numbers. If you want to reproduce a scenario where a user opens a website home page firing some parallel requests like the browser does for static assets then the batch could be the right way.

Let me know if it helps.

Thanks for giving an example for batch request. This helped.