"Active Users" metric growth extremely during "constantUsersPerSec" load strategy.

HiFirst of all I want to say that this tool is really amazing and I like it very much. After JMeter it looks brilliant ).

All works well when you try to simulate small amount of concurrent users. But if we are talking about thousands than got some weird behavior.

I want to simulate ramp up load strategy but using “constantUsersPerSec” method.

Here is my test


class AmazonScalingTest extends BaseTest {
val httpProtocol = http
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0”)
.contentTypeHeader(“application/json; charset=UTF-8”)

var addUsers = config.getInt(“users”)/10
var intervalTime = config.getInt(“time”)/10

var steps = new ListBufferInjectionStep
for {
i ← 1 to 10
} steps += constantUsersPerSec(addUsers*i) during (intervalTime minutes)

val scn = scenario(“Amazon scaling test.”)
.exec(http(“promotions search”)
setUp(scn.inject( steps )).protocols(httpProtocol)


I’ve ran it with next parameters : users - 3000, time - 360

Here my results

The problem is that Active Users goes to 100k what is not very good as for me. Why Gatling generates so many connections?

Here for example how looks “rampUsersPerSec” method for same request. But test much shorter - 1 minute and 5k users.

As you see number of Active Users is much better. I was expecting near same increment of users for “constantUsersPerSec” method. Did I do smth wrong?

I have found only one way to limit number of Active Users - to use “atOnceUsers” in specific way like this :


class SearchPromotionsAtOnce extends BaseTest {

val latitude = “40.747290” ;
val longitude = “-73.986667” ;

val scn = scenario(“Customer search test.”).during(config.getInt(“users”) minutes) {

.exec(http(“promotions search”)


Does anybody have ideas on this?

Gatling - 2.1.7
Env - test was ran at Linux Jenkins slave
Java - 1.8

What it looks like is the virtual user is living for 10 seconds after it completes, which is why you are seeing such a large number of active users. I do not know for sure, I am just guessing, but what if you turned off the connection keep-alive setting and try again? Perhaps the keep-alive is causing the virtual user to wait for the keep-alive timer to run out before exiting.

Thanks John,
I will try it tomorrow at let you know.


I had no possibility to do exactly same test case it take 6 hours. I’ve do same scenario but shorter.
For 3k users both configs works well. But with “keep-alive” option I was able to reach 8k users.
But without it - got fails after reaching 5k.
So without “keep-alive” test works more unstable - there are failed requests.

archive.zip (321 KB)