# java.net.ConnectException: Address already in use: no further information

**URL:** https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212
**Category:** Gatling (Open-Source)
**Created:** [April 16, 2015, 1:15pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212 "2015-04-16T13:15:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fugmag](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fugmag](https://community.gatling.io/u/fugmag)
#### Post date: [April 16, 2015, 1:15pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/1 "2015-04-16T13:15:22Z")

</div>

I am trying to run a “ping-test” against a static resource to test “the infrastructure”.  
my load model is as follows:

`setUp(scn.inject(constantUsersPerSec(1500) during (10 seconds))).protocols(httpConf)`

after som time running I get:

`  
15:06:38.138 [WARN] i.g.h.a.AsyncHandlerActor - Request ‘shitload’ failed: java.net.ConnectException: Address already in use: no further information

`

The Gatling version is 2.1.4 and

What might be the cause?

---

<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: [April 16, 2015, 1:37pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/2 "2015-04-16T13:37:03Z")

</div>

You’re probably running out of [ephemeral ports](http://en.wikipedia.org/wiki/Ephemeral_port).

---

<div class="post-metadata">

### Author: ![fugmag](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fugmag](https://community.gatling.io/u/fugmag)
#### Post date: [April 16, 2015, 1:43pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/3 "2015-04-16T13:43:18Z")

</div>

Ok, thanx.  
I am running from a Windows Server 2012 R2.  
Is there a way to “get more ephemeral ports”?

//Magnus

---

<div class="post-metadata">

### Author: ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)
#### Post date: [April 16, 2015, 1:54pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/4 "2015-04-16T13:54:50Z")

</div>

[http://lmgtfy.com/?q=windows+change+ephemeral+port+range&l=1](http://lmgtfy.com/?q=windows+change+ephemeral+port+range&l=1) 🙂

---

<div class="post-metadata">

### Author: ![fugmag](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fugmag](https://community.gatling.io/u/fugmag)
#### Post date: [April 16, 2015, 2:27pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/5 "2015-04-16T14:27:29Z")

</div>

Eh, sorry 🙂

---

<div class="post-metadata">

### Author: ![fugmag](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fugmag](https://community.gatling.io/u/fugmag)
#### Post date: [April 17, 2015, 11:36am UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/6 "2015-04-17T11:36:18Z")

</div>

Ok, I have increased the ephemeral ports to 65.000 but when I run a test with 1500 users per second in 10 seconds the first time it is ok.  
But when running it the second time I get:

> java.net.ConnectException: Address already in use: no further information  
> |
> 
> - |

When I run just one user I get the exception as well.

Do I need to terminate connections more than I have done in the example below? or tweak gatling.conf in someway? obviously the increase in ephemeral ports did not work.

`

**package** no.coop

**import** io.gatling.core.Predef.\_

**import** io.gatling.http.Predef.\_

**import** scala.concurrent.duration.\_

**class** isAlive **extends** Simulation{

**val** _httpConf_ = _http_

.baseURL(**“[http://grointtst.intrano.shell:88](http://grointtst.intrano.shell:88)”**)

.acceptHeader( **“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”** )

.doNotTrackHeader( **“1”** )

.acceptLanguageHeader( **“en-US,en;q=0.5”** )

.acceptEncodingHeader( **“gzip, deflate”** )

.userAgentHeader(**“Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0”**)

**val** _scn_ = _scenario_( **“isAliveSimulation”** )

.exec(_http_( **“shellload”** )

.get( **“/3mb.htm”** )

.check(_regex_( **“8.png”** )))

setUp(_scn_.inject(atOnceUsers(1))).protocols(_httpConf_)

_//setUp(scn.inject(constantUsersPerSec(1500) during (10 seconds))).protocols(httpConf)_

}

`

---

<div class="post-metadata">

### Author: ![fugmag](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fugmag](https://community.gatling.io/u/fugmag)
#### Post date: [April 17, 2015, 12:48pm UTC](https://community.gatling.io/t/java-net-connectexception-address-already-in-use-no-further-information/2212/7 "2015-04-17T12:48:12Z")

</div>

I also get:

`

java.net.ConnectException: No buffer space available (maximum 4 ( 0,27%)  
connections reached?): connect

`
