Running each VUs in order (sequential) and not in parallel

Hi all,

I have a script wherein I need to run each VUs sequentially:

    scenarios: {
        default: {
            // name of the executor to use
            executor: 'per-vu-iterations',

            // executor-specific configuration
            vus: 200,
            iterations: 1,
            maxDuration: '1h30m',

        },


             export default function () { //some request here }

    }

Basically, I have configured 200 VUs wherein each VU should iterate the default function for 1 time only and after being ran 1 time, proceed now with the another iteration using the 2nd VU.

I wanted it to run in sequential. The 2nd VU will not be used and the 2nd iteration wont start unless the 1st VU–1st iteration is finished.

Example:

a. 1st iteration will use 1st VU (including data sets of the 1st VU)
then after the 1st iteration was finished…
b. Proceed now to run again for the 2nd iteration but using the 2nd VU (including data sets of 2nd VU)
c. Repeat up until the 200th VU (so 200 iterations all in all)

In a lighter explanation: I just want to run the export default main into 200 times/iterations in order (not parallel) but having a different VUs for each iteration. Btw, I am importing a json file wherein it contains arrays or objects of data for each VUs to be used.

I am using per-vu-iterations as the executor but as far as I know, this executor runs the VUs concurrently. See Per VU iterations (k6.io)

Thanks

1 Like

Hi @mmm014 ,

From what you are explaining you want 1 VU doing 200 iterations.

You can use no vu connection reuse to not reuse connection between iterations. Cookies are already reset between iterations so it should work for you.

2 Likes

you could set iterations to 1 and then set the rampup time to match or exceed the cycle time for each iteration.

1 Like