I seem to have ran into the issue outlined at Can K6 support send requests at constant throughput? - #8 by nedyalko where using constant-arrival-rate
executor with sleep is reducing the desired request rate. But I am combining 2 scenarios where other one is ramping-vus
and I want to use sleep there. So how to I ensure only ramping-vus
uses the sleep parameter?
scenarios: {
// // scenario 1
// https://k6.io/docs/using-k6/scenarios/executors/constant-arrival-rate
constant_arrival_rate: {
executor: 'constant-arrival-rate',
startTime: '0s',
rate: `${__ENV.RPS}`,
timeUnit: '1s',
duration: `${__ENV.STAGETIME}`,
preAllocatedVUs: `${__ENV.REQRATE_USERS}`,
maxVUs: 150000,
gracefulStop: '5s',
tags: { executor: 'constant-arrival-rate' },
},
// scenario 4
// https://k6.io/docs/using-k6/scenarios/executors/ramping-vus
ramping_vus: {
executor: 'ramping-vus',
startTime: `${__ENV.STAGETIME + 18}s`,
// startTime: '0s',
startVUs: `${__ENV.USERS}` || 0,
stages: [
{ duration: `${__ENV.STAGETIME}`, target: `${__ENV.STAGE_VU1}` },
{ duration: `${__ENV.STAGETIME}`, target: `${__ENV.STAGE_VU2}` },
{ duration: `${__ENV.STAGETIME}`, target: `${__ENV.STAGE_VU3}` },
{ duration: `${__ENV.STAGETIME}`, target: `${__ENV.STAGE_VU4}` },
],
gracefulRampDown: '5s',
gracefulStop: '5s',
// tags: { executor: 'ramping-vus' },
},
},
export default function () {
const sleepMin = 1.5;
const sleepMax = 4.5;
sleep(randomIntBetween(sleepMin, sleepMax));
}