# Another concurrent user question. Still confusing

**URL:** <https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259>\
**Category:** Gatling (Open-Source)\
**Created:** [August 28, 2024, 7:25am UTC](https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259 "2024-08-28T07:25:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timmer](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@Timmer](https://community.gatling.io/u/Timmer)\
**Post date:** [August 28, 2024, 7:25am UTC](https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259/1 "2024-08-28T07:25:44Z")

</div>

**Gatling version** : 3.11.5 (must be up to date)  
**Gatling flavor** : [X] java kotlin scala javascript typescript  
**Gatling build tool** : [X] maven gradle sbt bundle npm

Hello Community,  
I just want to know if I have the following simulation:  
NOTE: feeder is set to circular

```java
    {
        setUp(simulationTest
            .injectOpen(rampUsers(10)
            .during(Duration.ofMinutes(2))))
            .protocols(httpProtocol)
            .maxDuration(Duration.ofMinutes(20));
    }

```

If it takes a single user 2 minutes to complete the scenario flow, since the request is for 10 users to execute concurrently, after the rampUpTime of 2 minutes, will Gatling just keep adding users continually to keep the concurrent user count at 10 until the 20 minutes is up?

If not, how would I change this so that after the ramp up time, the number of users stays consistently at 10

Thanks,  
Timmer

---

<div class="post-metadata">

**Author:** ![Shaun](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/shaun/32/1322_2.png) [@Shaun](https://community.gatling.io/u/Shaun)\
**Post date:** [August 28, 2024, 8:16am UTC](https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259/2 "2024-08-28T08:16:37Z")

</div>

To keep the number of users constant in your app, I think you should use a [closed work model](https://docs.gatling.io/reference/script/core/injection/#closed-model).

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [August 29, 2024, 1:48am UTC](https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259/3 "2024-08-29T01:48:33Z")

</div>

how about

```auto
.inject(
   rampConcurrentUsers(1).to(desiredUsers).during(UserRampTime),
   constantConcurrentUsers(desiredUsers).during(SteadyLength)
)

```

For this, you may need to use `.forever` in your loop too.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 29, 2024, 5:35am UTC](https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259/4 "2024-08-29T05:35:32Z")

</div>

Given the previous discussions, I think @trinp 's advice is better suited.  
IIRC, you want the same users to loop (reuse). Then use a loop.

Again, maxDuration neither makes your users loop or last longer, nor have any impact on your injection profile (which controls when new users are started).  
It forcefully stops the test after a given duration, typically when you’re using a `forever` loop of because your tests triggers so many long timeouts that it would take forever. As the name states, it just controls the maximum duration of the test.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [September 28, 2024, 5:36am UTC](https://community.gatling.io/t/another-concurrent-user-question-still-confusing/9259/5 "2024-09-28T05:36:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
