Max Number of Vus not matching with number of pods

Hi all,
I am using k6 oss via operator in k8. I initilize the test with parallelism 4 and emitting metrics to influx. Here is my options while setting up load test :

export const options = {
  scenarios: {
    ramping_arrival_rate: {
      executor: 'ramping-arrival-rate',
      startRate: 25, // Starting at 100 RPS
      timeUnit: '1s', // RPS will be calculated per second
      preAllocatedVUs: 200, // Preallocate 50 VUs
      maxVUs: 3500, // Maximum number of VUs
      stages: [
        { target: 125, duration: '3m' },   // Ramp up to 500 RPS in 3 minutes
        { target: 250, duration: '1m' },  // Ramp up to 1000 RPS in the next 2 minutes
        { target: 375, duration: '2m' },  // Ramp up to 1500 RPS in the next 2 minutes
        { target: 500, duration: '3m' },  // Finally ramp up to 2000 RPS in 3 minutes
        { target: 500, duration: '5m' },  // Maintain 2000 RPS for 5 minutes
        { target: 0, duration: '2m' },     // Ramp down to 0 RPS over 2 minutes
      ],
    },
  },
};
env: 
                - name: K6_OUT
                  value: influxdb=http://admin:admin@<influx>:8086/load_test_results

when i run my test I see 4 pods running but what I want to know is that when I query vus measurement shouldnt I get sum of all vus as 4*3500
ie

SELECT sum("value") FROM "rp_15d"."vus" WHERE  time >= now() - 24h and time <= now() GROUP BY time(1s) fill(none)

I am getting 3500 only what am I missing here ?

also on querying

select * from vus order by time desc limit 5;

I get

time                instance_id job_name    testid                  value
----                ----------- --------    ------                  -----
1727809082351878959 4           load-test-4 customer-api-2024-10-01 103
1727809082202016203 1           load-test-1 customer-api-2024-10-01 114
1727809082158752686 3           load-test-3 customer-api-2024-10-01 115
1727809081383938351 2           load-test-2 customer-api-2024-10-01 116
1727809081351539094 4           load-test-4 customer-api-2024-10-01 118

what is the value signifying here ?

Hi @vipulkhullar

I’m not quite sure that I’m getting your concerns here, but let me try to answer.

maxVUs refers to the maximum number of VUs allowed during the test run, but it’s an upper limit. If your target rate requires fewer VUs, k6 will use them, which I think happens for you.

Does that answer?

my ask is that if I write maxVus as 3500 and this script runs on 4 pods via k6 operator so will each pod have 3500 as max Vus or 3500/4 as maxVus ?

Hi @vipulkhullar,

if I write maxVus as 3500 and this script runs on 4 pods via k6 operator so will each pod have 3500 as max Vus or 3500/4 as maxVus ?

No, maxVUs is per test as a whole, not per instance. When you run distributed test like with k6-operator, those VUs are being split across the instances. In this case, k6-operator splits equally, that is 1/4 of the total workload is attached to each instance.

If you require four times more load for your test, you’d need to specify to specify other numbers for VUs, e.g. 3500 * 4.

Hope that helps.

hi thanks for the reply, so

 stages: [
        { target: 125, duration: '3m' },   // Ramp up to 500 RPS in 3 minutes
        { target: 250, duration: '1m' },  // Ramp up to 1000 RPS in the next 2 minutes
        { target: 375, duration: '2m' },  // Ramp up to 1500 RPS in the next 2 minutes
        { target: 500, duration: '3m' },  // Finally ramp up to 2000 RPS in 3 minutes
        { target: 500, duration: '5m' },  // Maintain 2000 RPS for 5 minutes
        { target: 0, duration: '2m' },     // Ramp down to 0 RPS over 2 minutes
      ],
    },

even these will split across instances ie the rps ?

can some one pls reply waht would be peak rps if I run with above stage across 4 instances