How can I reliably send 100 requests in 1 second using k6 without dropped iterations?
Hi everyone,
I’m trying to run a k6 test scenario to send exactly 100 requests within 1 second to an endpoint (extract service). My goal is to fire 100 requests simultaneously or as close to that as possible, but I’m running into issues.
export const options = {
scenarios: {
spike_100_at_once: {
executor: “ramping-arrival-rate”,
startRate: 0,
timeUnit: “1s”,
preAllocatedVUs: 150,
stages: [
{ duration: “10s”, target: 0 },
{ duration: “1s”, target: 100 },
{ duration: “5s”, target: 0 },
],
},
},
};
executor: “constant-arrival-rate”,
rate: 100,
timeUnit: “1s”,
duration: “1s”,
preAllocatedVUs: 150,
maxVUs: 1000,
gracefulStop: “0s”
- This gives me warnings like:
- “No script iterations fully finished, consider making the test duration longer”
- “Dropped iterations” if the duration is too short
- Ramp-up scenarios with staged VUs, but the actual request count and timing don’t match 100 requests in 1 second consistent,
- What I want:
To simulate 100 requests hitting the service all within 1 second, as part of a short, intense load spike.
Questions:
- What is the recommended approach in k6 for this kind of short burst testing?
- Is there a workaround to the duration-too-short problem for small window load tests?