Unwanted Repetition of Requests Within Requests Array When Connections More Than 1

Author: caseymorrisusCreated Apr 14, 2025Updated Apr 14, 2025

Info

I am trying to create a benchmark (programmatically) using the requests param. This array has 16 requests in it.

If I run the benchmark with connections set to 1 it iterates through all 16 requests as expected.

If I run the benchmark with connections set to anything over 1 — it no longer calls all 16 requests. Instead it doubles up the first requests in the array and never gets to the ones at the end of the array. If I set connections to 2 it doubles up the first 8 requests in the array and never fires off the last 8.

Config

javascript
autocannon({
  // url, title, etc
  requests,
  connections: 5,
  amount: requests.length,
})

Question

Is it possible for me to run all 16 requests in my requests array without setting connections to 1? I'd like to benchmark all 16 requests using more than 1 connection.