Question about the http.batch behaviour

Hi Community :wave:,

Have a small question about the http.batch method.
In my test suites, I have to prepare unique data in the DB (setup) before the actual run, and in the end to delete this data (teardown) from the DB.

I’m using http.batch in both setup and teardown because I found that very quick and efficient (for loop taking too much time).

But now I’m concerned with its efficiency, when I will run with 1000/10000/… unique data the http.batch will “kill” the DB API.
I tested 100 requests with http.batch and saw (in the back-end API) that it doesn’t send simultaneously all the 100 at once - which is good!


  1. Am I doing right with this method of the setup/teardown/http.batch?
  2. Does the http.batch has kind of a threshold for simultaneous requests (if I put a million requests in it, will it send a million at once)?


This is certainly one way of doing it! You may want to consider performing data prep as part of a separate test so that the HTTP metrics from the data prep don’t combine with the metrics of the actual load test (but there’s ways of dealing with this).

http.batch limits are set using options, specifically Batch and Batch per host. The default settings, at least for Batch per host, are intended to mimic what happens in a real browser (at least with HTTP/1.1) but the number changes depending on which browser you use. HTTP/2 multiplexes requests on a single connection (see this SO answer for a detailed description).


Thank you very much - that was super helpful.
BTW - I’m dealing with the metric with the help of this answer