K6 options stages, duration vs target confusion

I am very new to k6, and I am trying to understand workload option stages:

This is the sample soak test stages in k6 documentations:

export const options = {
  stages: [
    { duration: '2m', target: 400 }, // ramp up to 400 users
    { duration: '3h56m', target: 400 }, // stay at 400 for ~4 hours
    { duration: '2m', target: 0 }, // scale down. (optional)

In line number 2, it says stay at 400 for 3h56m, so my confusion is it making 400 request at a time? How often it makes that 400 request in every second, every millisecond or every minutes?

What will determine how often that request will make or the interval for that request or how does it work in reality?

These options are not about making requests, the stages option is a shortcut for configuring the ramping-vus executor. That is, how many VUs are going to be looping through your default function at any given time. The amount of requests depends entirely on the contents of that function and on the server response times.

If you want to express the test in terms of requests per second, or rather, iterations per second, you should use one of the arrival-rate executors. Here are some links to get you started:

This is very helpful. Thank you.

1 Like