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

537 views
Skip to first unread message

Denis Veselovskiy

unread,
Sep 23, 2015, 5:32:52 AM9/23/15
to Gatling User Group

Hi
First 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
    .baseURL(config.getString("url"))
    .userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0")
    .contentTypeHeader("application/json; charset=UTF-8")
    .connection("keep-alive")
    .shareConnections
    .disableWarmUp

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

  var steps = new ListBuffer[InjectionStep]()
  for {
    i <- 1 to 10
  } steps += constantUsersPerSec(addUsers*i) during (intervalTime minutes)

  val scn = scenario("Amazon scaling test.")
      .exec(http("promotions search")
      .get("/customer/promotions/search")
      .check(status.is(200)))
  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")
    .get("/customer/promotions/search")
    .check(status.is(200)))
  }
  setUp(scn.inject(atOnceUsers(config.getInt("users"))).protocols(httpProtocol))
}



Does anybody have ideas on this?


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



John Arrowwood

unread,
Sep 24, 2015, 10:10:48 AM9/24/15
to Gatling User Group
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.

Kashey

unread,
Sep 24, 2015, 3:37:28 PM9/24/15
to gat...@googlegroups.com
Thanks John,
I will try it tomorrow at let you know. 

--
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/fphrtnJe3mU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Denis Veselovskiy

unread,
Sep 25, 2015, 10:50:47 AM9/25/15
to Gatling User Group
Hi

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
Reply all
Reply to author
Forward
0 new messages