# Why Active users number is less...???

**URL:** <https://community.gatling.io/t/why-active-users-number-is-less/1707>\
**Category:** Gatling (Open-Source)\
**Created:** [November 15, 2014, 8:15am UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707 "2014-11-15T08:15:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![47saikumar](https://avatars.discourse-cdn.com/v4/letter/4/a9a28c/32.png) [@47saikumar](https://community.gatling.io/u/47saikumar)\
**Post date:** [November 15, 2014, 8:15am UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/1 "2014-11-15T08:15:22Z")

</div>

Hi,

I am new to gatling…I did one simulation for my application…Actually I gave 1000 users and 4000 ramp up…But in the results I am not getting 1000 active users…By seeing the numbers

I confused…whats happening behind the scene???I want to know…And In this how to calculate concurrent users and simultaneous users???For reference I am adding results graphs in text file…

I am not getting any error on console and all requests are passing…But why active user count is less??? please explain in detail…

[Simulation results.docx](https://community.gatling.io/uploads/short-url/oVliPASdv96C459BIgoJyPV22EA.docx) (184 KB)

---

<div class="post-metadata">

**Author:** ![Abhinav\_Gogna](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Abhinav\_Gogna](https://community.gatling.io/u/Abhinav_Gogna)\
**Post date:** [November 16, 2014, 6:02am UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/2 "2014-11-16T06:02:15Z")

</div>

Can you post your Simulation code.

---

<div class="post-metadata">

**Author:** ![47saikumar](https://avatars.discourse-cdn.com/v4/letter/4/a9a28c/32.png) [@47saikumar](https://community.gatling.io/u/47saikumar)\
**Post date:** [November 17, 2014, 11:15am UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/3 "2014-11-17T11:15:03Z")

</div>

setUp(scn.inject(rampUsers(1000) over(4000))).protocols(httpProtocol)

---

<div class="post-metadata">

**Author:** ![Alex\_Bagehot](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@Alex\_Bagehot](https://community.gatling.io/u/Alex_Bagehot)\
**Post date:** [November 17, 2014, 12:14pm UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/4 "2014-11-17T12:14:52Z")

</div>

Hi there,  
Your attachment said the load injection was “Setup used ------------:setUp(scn.users(1000).ramp(4000).protocolConfig(httpConf)”  
which is gatling 1 syntax, and different from the line you just provided. So I have little confidence currently that the results page comes from the latest version of Gatling.

Can you rerun your test and provide the results page with the latest version of gatling, please?  
stating which version of gatling you ran.  
providing the console output would be of use also.

thanks,  
Alex

---

<div class="post-metadata">

**Author:** ![47saikumar](https://avatars.discourse-cdn.com/v4/letter/4/a9a28c/32.png) [@47saikumar](https://community.gatling.io/u/47saikumar)\
**Post date:** [November 17, 2014, 12:52pm UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/5 "2014-11-17T12:52:51Z")

</div>

Sorry,For confusion…wat ever I gave for gatling 2 is correct one…Please give me solution based on that…

---

<div class="post-metadata">

**Author:** ![jarrowwx](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jarrowwx](https://community.gatling.io/u/jarrowwx)\
**Post date:** [November 20, 2014, 6:09pm UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/6 "2014-11-20T18:09:53Z")

</div>

In order for you to see 1000 active users, each user must continue to run for the duration of the test. With a ramp of 4000, each user must keep running for at least 4000 seconds. You will need to use some kind of looping in your scenario.

---

<div class="post-metadata">

**Author:** ![47saikumar](https://avatars.discourse-cdn.com/v4/letter/4/a9a28c/32.png) [@47saikumar](https://community.gatling.io/u/47saikumar)\
**Post date:** [November 21, 2014, 6:32am UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/7 "2014-11-21T06:32:41Z")

</div>

John,Thanks for the response…but to see 1000 active users I have to loop the simulation 1000 times or what is the way??I am in confusion…So please explain with example code…And there are lot of looping concepts in gatling…So which one will be adoptable for this scenario??How active users concept is there is gatling please explain in the internal architecture…please help…

---

<div class="post-metadata">

**Author:** ![jarrowwx](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jarrowwx](https://community.gatling.io/u/jarrowwx)\
**Post date:** [November 21, 2014, 6:00pm UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/8 "2014-11-21T18:00:31Z")

</div>

Gatling 101:

If your “scenario” is one transaction, and that transaction takes 1 second, then the whole thing is finished in 1 second.

If you inject 50 users over 50 seconds, you will never have more than one active user at a time.

In order to have 50 users active at the same time, the users must be long-running. You can make them long running by simply adding a loop. The simplest way to do this is to use “during”

`val scn = scenario ( "name" ) .during( 60 seconds ) { // target running time + ramp time is best // do your stuff here - without the initial "." for the first exec() }`

The documentation is not as user-friendly as it could be for total newbies, I admit. All in due time. But take the time to read it and understand it, and you won’t be as frustrated.

---

<div class="post-metadata">

**Author:** ![47saikumar](https://avatars.discourse-cdn.com/v4/letter/4/a9a28c/32.png) [@47saikumar](https://community.gatling.io/u/47saikumar)\
**Post date:** [November 26, 2014, 6:28am UTC](https://community.gatling.io/t/why-active-users-number-is-less/1707/9 "2014-11-26T06:28:01Z")

</div>

Thank you so much john…its working…
