I’m working on a load test scenario in K6 where I need each Virtual User (VU) to process unique data from a CSV file. Here’s what I’ve tried so far:
export const options = {
scenarios: {
functionName: {
executor: “constant-vus”,
exec: “functionName”,
duration: “5s”,
vus: 3, // Number of VUs
},
},
thresholds: {
http_req_duration: [“p(95)<500”],
},
};
let data = itemData[__VU - 1].code;
However, with this setup, I’m noticing that the same data (the first row of the CSV) is being used by all VUs. I want each VU to read a unique row from the dataset so that VU1 gets the first row, VU2 gets the second row, and so on.
Questions:
- How can I configure K6 with the
constant-vus
executor to ensure each VU uses unique data? - Is there a specific executor better suited for this use case?
Any insights or examples would be greatly appreciated! Thank you in advance!