About the number of users in the stress test documentation

Hi, Im new to k6. I have been reading the stress test documentation and cant really figure out where the “100 users every 2 minutes” come from.

The stages of the code example look like this:

      timeUnit: "1s",
      stages: [
        { duration: "2m", target: 10 }, // below normal load
        { duration: "5m", target: 10 },
        { duration: "2m", target: 20 }, // normal load
        { duration: "5m", target: 20 },
        { duration: "2m", target: 30 }, // around the breaking point
        { duration: "5m", target: 30 },
        { duration: "2m", target: 40 }, // beyond the breaking point
        { duration: "5m", target: 40 },
        { duration: "10m", target: 0 }, // scale down. Recovery stage.
      ],

and the note below the code example says:

This configuration increases the load by 100 users every 2 minutes and stays at this level for 5 minutes. We have also included a recovery stage at the end, where the system is gradually decreasing the load to 0.

But then the documentation about the ramping-arrival-rate executor has an example with comments that look like this:

stages: [
        // It should start 300 iterations per `timeUnit` for the first minute.
        { target: 300, duration: '1m' },
        // It should linearly ramp-up to starting 600 iterations per `timeUnit` over the following two minutes.
        { target: 600, duration: '2m' },
        // It should continue starting 600 iterations per `timeUnit` for the following four minutes.
        { target: 600, duration: '4m' },
        // It should linearly ramp-down to starting 60 iterations per `timeUnit` over the last two minute.
        { target: 60, duration: '2m' },
      ],

If I understant the comments correctly that means that in the first example the initial stage would ramp up to 10 iterations per second for two minutes and the next stage would keep that rate for five minutes, so my two questions are:

  • Where does the “100 users every 2 minutes” number comes from? How is it calculated?
  • What are “users” in this context? VUs? If so, again, how is the number determined?

Thanks.

Hi @roig Metrics of 100 user every 2 minutes comes from graph which show VUs against time, and ramping arrival rate only controls number of iteration per unit time but number of VUs may varies to maintain required RPS.

2 Likes

So, its not calculated from the config but just describing the graph?

Hi @roig Exactly the result of VUs describe in graphs at each stages against time.

2 Likes

That makes it clear. Thank you