How to define a scenario 1000 Users run only 1 iteration with in 10 minutes of duration

Hello,

I just want to define a scenario as follows, please let me know how to define in the K6.

  • 1000 Users

  • 1 Iteration only

  • 10 Minutes time duration

Thanks,

Hello @venkatareddy
Could you please provide more traffic pattern about each user when using k6, considering that it has multiple scenarios.

Best Regards.

1 Like

@Elibarick

I have to define a scenario like 1000 iterations to complete with in 10 minutes of duration with 1000 unique users load.

Hello @venkatareddy

For each user to executte one iteration using k6 provides per-vu-iterations as executor

        load: {
          executor: 'per-vu-iterations',
          vus: 1000,
          iterations: 1000,
          duration: '10m'
        }

Cheer Regard!

@Elibarick

per_vu_iterations executor doesn’t have duration property. It has maxDuration instead, but it may cause the test to run faster than 10 minutes. @venkatareddy : is it acceptable to complete the test faster than 10 minutes?

2 Likes

@bandorko @Elibarick

Thanks for your inputs, yes, I used the below code…

export const options = {
  scenarios: {
'load': {
  executor: 'per-vu-iterations',
  vus: 10,
  iterations: 100,
  maxDuration: '10m'
    },
  },
}

However it’s getting faster to complete as 10 users 100 iterations before 10 minutes time… whichever is faster it is taking… And Its taking 10 concurrent users initially and starting 10 concurrent users always…

so I think we need to use the sleep time for each iteration time …

In JMeter, we can use 1000 thread and ramp-up period (seconds) : 600 and iteration 1 this runs as 1000 users distributed during 10 minutes time (like each user ramp-up 1.61sec)

so is there a way we can design ramp-up 1000 users in the span of 10 minutes time… every 1.61 seconds 1 user ramp-up ?

@venkatareddy

Could you try with this?

export const options = {
  scenarios: {
    load: {
      executor: 'constant-arrival-rate',
      duration: '10m',
      rate: 1000,
      timeUnit: '10m',
      preAllocatedVUs: 1000,
    },
  },
};
3 Likes

Try this

export let options = {
  stages: [
    {
      duration: '10m',
      target: 1000,
    },
  ],
}

NOTE: This approach doesn’t mean that users will iterate only once per test script.

@bandorko Thanks. its working fine as expected.

2 Likes