Question regarding rampusers and constantusers

I am new to Gatling as well as performance testing and got confused about the rampUsersPerSec and contantUsersPerSec.

Can someone pls validate my understanding:

constantUsersPerSec(10).during(20) - Does it mean that gatling will fire 10 requests per second for a duration of 20 seconds which means total of 200 requests in execution?

rampUsersPerSec(5).to(10).during(20) - Does it mean that gatling will fire 5 to 10 requests per second for total duration of 20 seconds and total of 200 requests in executions? Does it ensure that at the end of the execution, total no of requests fired is 200.

I want to do a soak testing for api and want to gradually increase the load for a duration of one hour and test the behaviour of api at peak load of 3000 TPS.

Will this fulfill my requirement ? rampUsersPerSec(50).to(3000).during(3600)

Any help is much appreciated!!

Hi @saxenaj
First of all you must have on your mind that Users # Requests in Gatling.
Gatling working in little diffrent way and first of all you must understand that.

For your questions and what I understood from your post best Injection profile will be:

Best way to figureout how how work injection it’s preprare simple Gatling Simulation and check after that Reports.
In reports you will se if this profile do that you want :slight_smile:

1 Like

These injection profiles define a number of users not requests. This number only matches the number of requests if your scenario consists of only one single request.

constantUsersPerSec(10).during(20) means start 10 users per second during 20 seconds, so a total of 200 users.

rampUsersPerSec(5).to(10).during(20) means start at 5 users the first second and then linearly accelerate to 10 users after 20 seconds, so a total of (5 + 10) / 2 * 20 = 150 users.

I want to do a soak testing for api and want to gradually increase

That’s not what a soak test is. A soak test is maintaining a constant load for a long time to detect resources leaks. You’re meaning a capacity test.

I recommend that you watch this talk: Load Testing Crash Course with Gatling by Stéphane Landelle - YouTube

Cheers

2 Likes