rhbc73
rhbc73

Reputation: 767

constantUsersPerSecond in Gatling

I'm using Gatling to run loadtest.

I've put all the queries (3million queries in total) in a log file and load it into a feed

val feeder = tsv(logFileLocation).circular
val search =
  feed(feeder)
      .exec(
         http("/")
         .get("${params}")
         .headers(sentHeaders)
       ).pause(1)

As for the simulation, I want 50 users concurrently and peak request at 50/seconds so I set up this way

setUp(myservicetest.inject(atOnceUsers(50))).throttle(
    reachRps(50) in (40 minutes), jumpToRps(20), holdFor(20 minutes)).maxDuration(60 minutes).protocols(httpProtocol)

My assumption is these 50 users each loads the queries and starts from fisr to last queries. Because there are enough queries to execute, these 50 users will always stay on line for the whole duration (60 mins)

But when I ran it, I saw user1 runs query1, user2 runs query2, .. user50 runs query50. Every user just runs 1 query and then quit. So exactly 50 queries were executed in the loadtest and it finished quickly.

SO my question is, say I have 3 million queries in tsv(logFileLocation).circular and multiple users, will each user starts from query1 and try to execute all 3m queries. Or each user is scheduled to run part of the 3m queries and if enough time is allocated, at the end of the test all 3m queries are executed for just once?

Thanks

Upvotes: 1

Views: 167

Answers (1)

Stéphane LANDELLE
Stéphane LANDELLE

Reputation: 6608

Disclaimer: Gatling's author here

The latter: "at the end of the test all 3m queries are executed for just once". Each virtual user performs its scenario. Injection profiles only controls when new virtual users are started. If you want virtual users to perform more than one request, you have to include that in your scenario, eg with loops and pauses.

Those are Gatling basics, I recommend you have a look at the new Gatling Academy courses we've just launched.

Upvotes: 1

Related Questions