# Simulate a number of active users

**URL:** <https://community.gatling.io/t/simulate-a-number-of-active-users/3082>\
**Category:** Gatling (Open-Source)\
**Created:** [June 16, 2016, 2:49pm UTC](https://community.gatling.io/t/simulate-a-number-of-active-users/3082 "2016-06-16T14:49:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henri\_Tremblay](https://avatars.discourse-cdn.com/v4/letter/h/82dd89/32.png) [@Henri\_Tremblay](https://community.gatling.io/u/Henri_Tremblay)\
**Post date:** [June 16, 2016, 2:49pm UTC](https://community.gatling.io/t/simulate-a-number-of-active-users/3082/1 "2016-06-16T14:49:57Z")

</div>

Hi,

I do hope it is a stupid question but I couldn’t figure out how to do it easily.

I have a system that should sustain let’s say 1000 active users. My users are coming to the site, they browse 2-3 pages and then they leave.

I don’t want to think in terms of RPS, I want to think in users.

The only think I can do so far is experimenting with rampUsersPerSec until I find the rate that will provide the right amount of active users.

What I would like is:

```auto
setUp(scn.inject(constantUsersPerSec(100) during(30 minutes))).throttle(
  reachActiveUsers(1000) in (15 minutes),
  holdFor(15 minutes)
)

```

This seems like a classical scenario. It is possible to do the equivalent?

Thanks,  
Henri

---

<div class="post-metadata">

**Author:** ![Slavik\_Fursov](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Slavik\_Fursov](https://community.gatling.io/u/Slavik_Fursov)\
**Post date:** [May 12, 2017, 11:33pm UTC](https://community.gatling.io/t/simulate-a-number-of-active-users/3082/2 "2017-05-12T23:33:27Z")

</div>

Hi, Henri!

Have you found the answer?  
I have exactly same issue.

I can use Apache Bench like that:  
$ ab -k -c 1000 -n 1000000 “[http://10.20.30.40/id1/id2?q1=v1](http://10.20.30.40/id1/id2?q1=v1)”  
Requests per second: 5424.66 [#/sec] (mean)  
Time per request: 184.343 [ms] (mean)  
Time per request: 0.184 [ms] (mean, across all concurrent requests)

But Apache Bench is not “smart enough” to parameterize IDs in the requests.  
So, I wanted to use Gatling, and I can’t find the way to measure RPS under user’s loads. Seems like it designed to only measure site performance under given RPS load.

---

<div class="post-metadata">

**Author:** ![Slavik\_Fursov](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Slavik\_Fursov](https://community.gatling.io/u/Slavik_Fursov)\
**Post date:** [May 13, 2017, 12:23am UTC](https://community.gatling.io/t/simulate-a-number-of-active-users/3082/3 "2017-05-13T00:23:59Z")

</div>

I’m trying different ways of doing that.  
I was thinking that my code below would achieve that goal (50 users sending 80 requests each), but it only sends 50 requests.

```auto
package commonCollection

import io.gatling.core.Predef._
import io.gatling.http.Predef._

class ScsPerformanceSimulation extends Simulation {
  val scsUsers = 50
  val scsReqPerUser = 80

  val scs = exec(http("Test").get("/"))

  val httpConf = http
    .baseURL("http://example.com")

  val scn = scenario("Performance Test")
    .repeat(scsReqPerUser) {
      exec(scs)
  }

  setUp(
    scn.inject(atOnceUsers(scsUsers))
  ).protocols(httpConf)
}

```

```auto

```

```auto
I'm using Gatling 2.2.5

```

```auto
What I'm not doing right? How can I have X number of users sending Y number of requests, without any relation to the duration?

```

---

<div class="post-metadata">

**Author:** ![Slavik\_Fursov](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Slavik\_Fursov](https://community.gatling.io/u/Slavik_Fursov)\
**Post date:** [May 13, 2017, 12:45am UTC](https://community.gatling.io/t/simulate-a-number-of-active-users/3082/4 "2017-05-13T00:45:59Z")

</div>

Ok, I figured…  
I had to disable cache:

```auto
val httpConf = http
  .baseURL("http://example.com")
  .disableCaching

```

Now, I’m getting 4000 requests.
