Per Vu user with stages

Hello Team

I have around 1000 users in my json file which i am importing in my js file using sharedArray

Now i want to make http.post call using username and password available in json file . I was able to achieve this using per_vu iteration

But then i wanted to also check the response on different stages , like ramp up and ramp down

Is there a way we can ramp up and down for per vu iteration?

If i use rampup vu , will i still be able to make unique call for each VU??

Hi @Harshsahay

Are you referring to using Ramping VUs? The VUs will work similarly, with the same test lifecycle. The executor will just adjust the number of VUs each stage is running.

If you still have doubts, it’s usually best if you can share your (sanitized) script/s so we can better understand your context.

Cheers!

Hello @eyeveebe How are you?

I had a new situation here :slight_smile:
so i was using :slight_smile:

export const options = {
   scenarios: {
     login: {
         executor: 'per-vu-iterations',
        vus:20,
      maxDuration:'20s',
},
   },

And my expectation was when i run this command , 20 second time should be divided between 1 VU , basically 1 VU= 1 Second , but when i checked logs - i was getting

running (16.7s), 00/20 VUs, 20 complete and 0 interrupted iterations
login βœ“ [======================================] 20 VUs  16.7s/20s  20/20 iters, 1 per VU

so instead of running for 20 seconds , it completed in 16.7 seconds :frowning: what could be the reason?

2- And also i wanted to know if i am using per-vu-iteration executor and i want to run it in stages

like my ./data.json file has 1200 users and i want to run 1200 users for 2 hours for example - i give following command

export const options = {
   scenarios: {
     login: {
       executor: 'per-vu-iterations',
       vus: data.length,
        maxDuration: '20s',
       
     },

And in default function :

export default function () {

    const importData = data[vu.idInTest - 1];
}
//code

Now i want to run it in stages ,

export const options = {
   scenarios: {
     login: {
         //executor: 'per-vu-iteration',
         executor: 'ramping-vus',
        stages: [
{ duration: '1h', target: 200 },
 { duration: '1h', target: 250 },
{ duration: '30m', target: 300 },
 {duration: '30m', target: 400 },
       ],
},
   },

is it possible to use stages with per-vu-iteration?

Also , how if i want to Achieve - running 100 VU for 100 minutes , then 1 VU should be executed every 1 minute. How can this be acheived?

Hi @Harshsahay,

Why do you expect to get 1 VU = 1s? What is the value of the iteration_duration metric?

You can use the Ramping VUs setting { duration: '100m', target: 100 }.

It is not possible to use stages with per-vu-itarations. stages is supported by Ramping VUs and Ramping arrival rate.

Let me know if it helps.

1 Like