How to add 100 more users each 3 minutes with the same scenario ?

I have 1 scenario and I want to execute it in the following manner :

  • Launch 100 VU and run for 3 minutes (total VU : 100)

  • Add 100 more VU and run for 3 minutes (total VU: 200)

  • Add 100 more VU and run for 3 minutes (total VU: 300)

  • Add 100 more VU and run for 3 minutes (total VU: 25 000)
    Do you know how Gatling could handle that simply ?

Thanks in advance

Hi Frederic,

There is no way to have this automated by Gatling.

Although, you can use multiscenario simulations to achieve your goal (with a little calculus ;))

At the end of the simulation, you can add as much scenario configurations as you want; thus, you could add 250 configurations…

I admit, it is not nice, and might need some new feature for this kind of behavior.

We could add a new configuration param such as incrementalRamp :

scn.configure.users(100).incrementalRamp(100, 3, MINUTES) // This could mean add 100 users every 3 minutes.

Gatling could then generate the load you want to.

Until such a feature is added, there’s no other way for you than specifying the 250 configs with appropriate delays, sorry for that!

Cheers,

Romain

Hum…
Sorry mate, but of course there is a way!

Use “delay” as explained here: https://github.com/excilys/gatling/wiki/Advanced-Usage#wiki-multi-scenario

Then, instead of returning a statically built List as usual, you can shape your profile like this:
for (i ← 0 to 25) yield scn.configure.users(100).delay(i * 3, MINUTES).protocolConfig(httpConf)

I haven’t played with a delay(0), so I’m not sure it works.
If it doesn’t, use something like this:
scn.configure.users(100).protocolConfig(httpConf) :: for (i ← 1 to 25) yield scn.configure.users(100).delay(i * 3, MINUTES).protocolConfig(httpConf)

Am I clear enough?

Cheers,

Steph

2012/6/18 Romain Sertelon <bluepyth@gmail.com>

I will test that ASAP and keep you informed

Thanks

Haha, didn’t see that x)

Sorry Frederic :slight_smile:

BTW, maybe you simplified your exemple, but you’d better use a ramp, even if you really want to use delays.

As Gatling is much more efficient that some other tools, you don’t get this kind of “natural dispersion” of your users over time.
Without a ramp, yours users will be launched within a ~30ms window (currentTimeMillis + HashedWheelTimer imprecision) and will be more or less synchronized, so you will be hammering your server.

I personally would write:
for (i ← 0 to 25) yield scn.configure.users(100).ramp(1, MINUTES).delay(i * 3, MINUTES).protocolConfig(httpConf)

Cheers,

Steph

2012/6/18 Romain Sertelon <bluepyth@gmail.com>