Why k6 ramping vus doesn't increase http requests

Hi there !

I’m working with k6 to create stress test for an API. It’s working and i think i understand how it mainly works but i have something that i’m still not understanding.

So, i want to ramp up VUs like this :

scenarios: {
    ramping: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [
        { duration: '10s', target: 10 },
        { duration: '20s', target: 10 },
        { duration: '10s', target: 20 },
        { duration: '20s', target: 20 },
        { duration: '10s', target: 30 },
        { duration: '20s', target: 30 },
        { duration: '10s', target: 40 },
        { duration: '20s', target: 40 },
        { duration: '10s', target: 50 },
        { duration: '20s', target: 50 },
        { duration: '30s', target: 0 }
      ]
    }
  },

And here is the result :

As you can see, my users are ramping up over the time and the response time is also increasing.
So my first question is : Why is the request rate still at the same rate when i’m increasing VUs ?
In docs, i only found this : Ramping VUs
It says that no matter of VUs, it will send as much http requests as it can. Am i right ?

If it is, here is my second question : Why is it better to do this for a stress test instead of increasing req/s with VUs increasing ?

Thanks for your responses

Hi @Bastion

As a basic principle the number of reqs/s should increase if you increase the number of VUs. If you’re increasing the number of VUs and the requests are not increasing over time you must check if there a setting configured in your WebServer app, LoadBalancer of whatever sits in front of your API that is limiting the number of concurrent connections to the server.

Could your please point me to where did you find this information?

I’m not sure if I did understand this question. If you don’t mind to explain it a little bit more?

Hi @rdt.one

Thank you for responding me !

Could your please point me to where did you find this information?

If found it here : Ramping VUs
On the top, it says :
“A variable number of VUs execute as many iterations as possible for a specified amount of time.”

Maybe i misunderstood this information. For me, it says that i will have the same http request amount for 1 VU and for 50 VUs, the change will be the response time.

I’m not sure if I did understand this question. If you don’t mind to explain it a little bit more?

In case that “no matter of VUs”, http requests stay the same, and the only change is response time. Why should that be better than increase VUs will make http req increase too.

Hi @Bastion,
welcome to the community forum :tada:

Your understanding about the ramping-vus executor is mostly right.

It seems your system under test can’t handle a higher rate. You can find more details about the dependency between the duration and the requests and the eventual alternative in this documentation’s page about open/closed models.

Let me know if it helps.

Yes, thank you @codebien ! It helps me a lot ! :slight_smile: