# concurrent users negative number

**URL:** <https://community.gatling.io/t/concurrent-users-negative-number/4741>\
**Category:** Gatling (Open-Source)\
**Created:** [January 4, 2019, 8:13am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741 "2019-01-04T08:13:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martijn\_Kuypers](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Martijn\_Kuypers](https://community.gatling.io/u/Martijn_Kuypers)\
**Post date:** [January 4, 2019, 8:13am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741/1 "2019-01-04T08:13:30Z")

</div>

I’ve got a problem that sometimes the concurrent users in my simulation turn into a negative number.

example

```auto
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ================================================================================
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m 2019-01-02 13:24:24 615s elapsed
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- Requests ------------------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > Global (OK=127643 KO=17112 )
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > PUT Notam (OK=40350 KO=0 )
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > POST WX (OK=40350 KO=0 )
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > PUT Device (OK=46943 KO=17112 )
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- Errors --------------------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > status.find.is(200), but actually found 405 17013 (99.42%)
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > status.find.is(200), but actually found 502 80 ( 0.47%)
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > i.g.h.c.i.RequestTimeoutException: Request timeout to loadsec. 16 ( 0.09%)
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m aviovision.com/10.1.0.64:443 after 60000 ms
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m > status.find.is(200), but actually found 503 3 ( 0.02%)
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m 
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- put User ------------------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m active: 0 / done: 0     
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- legs scenario -------------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m active: 0 / done: 0     
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- post Notification ---------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m active: 0 / done: 0     
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- Airport entities ----------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m active: 0 / done: 40350 
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- put BriefingAttachment ----------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m active: 0 / done: 0     
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ---- put Device ----------------------------------------------------------------
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m active: -16 / done: 64055 

```

```auto
build	04-Jan-2019 00:00:20	e[36mgatling_1 |e[0m ================================================================================

```

```auto

```

```auto
goes to

```

```auto

```

---

<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:** [January 4, 2019, 8:23am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741/2 "2019-01-04T08:23:02Z")

</div>

Which version of Gatling do you use?  
Can you please provide a way to reproduce your issue?

---

<div class="post-metadata">

**Author:** ![Martijn\_Kuypers](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Martijn\_Kuypers](https://community.gatling.io/u/Martijn_Kuypers)\
**Post date:** [January 4, 2019, 8:31am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741/3 "2019-01-04T08:31:27Z")

</div>

I’m using Gatling 3.0.0 in a docker container on a bamboo build agent.

I can’t exactly provide the whole simulation.

But the setup is like this:

A bunch of small scenario’s with api requests in setup like:

```auto
//Notification body
val notificationBody = "bodyurl.xml"

//post Notification scenario
val postNotification = scenario("post Notification")
  .exec(http("Post Notification")
    .post("apipath")
    .headers(headers_contentXml)
    .body(RawFileBody(notificationBody))
    .check(status.is(200))
  )

```

scenarios run like

```auto
//run the test
setUp(
  airportScenario.inject(
    constantConcurrentUsers(concurrentUsers) during (durationPerScenario seconds)
  ),
  putDevice.inject(
    constantConcurrentUsers(0) during (waitForPrevScen(durationPerScenario) seconds), //1
    constantConcurrentUsers(concurrentUsers) during (durationPerScenario seconds) //2
  ),
  postNotification.inject(
    constantConcurrentUsers(0) during (waitForPrevScen(durationPerScenario) seconds), //1
    constantConcurrentUsers(concurrentUsers) during (durationPerScenario seconds) //2
  ),
  putUser.inject(
    constantConcurrentUsers(0) during (waitForPrevScen(durationPerScenario) seconds), //1
    constantConcurrentUsers(concurrentUsers) during (durationPerScenario seconds)//2
  ),
  putBriefingAttachment.inject(
   constantConcurrentUsers(0) during (waitForPrevScen(durationPerScenario) seconds), //1
    constantConcurrentUsers(1) during (durationPerScenario seconds)//2 only 1 user for this scenario for now
  ),
  legsScenario.inject(
    constantConcurrentUsers(0) during (waitForPrevScen(durationPerScenario) seconds),
    constantConcurrentUsers(concurrentUsers) during (durationPerScenario seconds)//2
  )
).assertions(
  global.responseTime.percentile3.lt(5000), //global response time 95 percentile must be less than 5 seconds
  forAll.failedRequests.percent.lte(5), //Max percentage of failure for each requests must be lower or equal to 5%
  forAll.responseTime.percentile3.lte(2000) //the 95 percentile for each request must be lower or equal to 2 seconds
).protocols(httpConf)

```

an extra possibly important note is that the previous scenario was receiving a lot of errors from the application, I wonder if this could be the cause to the simulation breaking.

---

<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:** [January 4, 2019, 8:44am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741/4 "2019-01-04T08:44:29Z")

</div>

> I’m using Gatling 3.0.0

In [this mailing list’s rules]([http://Check](http://Check) that you’re not running an old version and that upgrading doesn’t fix your problem), we explicitly ask that people check latest version before posting for a very good reason: it could save a lot of time and frustration.

In your case, there’s a good chance your problem is [https://github.com/gatling/gatling/issues/3607](https://github.com/gatling/gatling/issues/3607), which has already been fixed in 3.0.1 as indicated. Latest Gatling is 3.0.2.

_Stéphane Landelle_

**GatlingCorp CTO**  
[slandelle@gatling.io](mailto:slandelle@gatling.io)  
 ![](https://docs.google.com/uc?export=download&id=0B-eSbAvpZEjTVnRCb212SzY1TVE&revid=0B-eSbAvpZEjTVnZyZExySlZDMHZXYnJUa3N3TFBjTWxSdG40PQ)

---

<div class="post-metadata">

**Author:** ![Martijn\_Kuypers](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Martijn\_Kuypers](https://community.gatling.io/u/Martijn_Kuypers)\
**Post date:** [January 4, 2019, 9:07am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741/5 "2019-01-04T09:07:34Z")

</div>

My sincerest apologies, I will update and evaluate.

---

<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:** [January 4, 2019, 9:28am UTC](https://community.gatling.io/t/concurrent-users-negative-number/4741/6 "2019-01-04T09:28:50Z")

</div>

Thanks!

Please report again if problem persists.  
But then, I’m afraid this kind of random issue are impossible to debug without a way to reproduce.  
If you can’t build a sample app that exhibits the same issue, please consider sharing an access to your app privately.

Regards,
