# Connection limit on Windows

**URL:** <https://community.gatling.io/t/connection-limit-on-windows/2147>\
**Category:** Gatling (Open-Source)\
**Created:** [March 27, 2015, 1:06am UTC](https://community.gatling.io/t/connection-limit-on-windows/2147 "2015-03-27T01:06:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Bo](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brian\_Bo](https://community.gatling.io/u/Brian_Bo)\
**Post date:** [March 27, 2015, 1:06am UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/1 "2015-03-27T01:06:31Z")

</div>

I’m running Gatling 2.0 on Windows 7 and try to simulate a large number of users hitting our server. When I run my Gatling test with 20000 sessions, I get the following errors a few minutes after the test starts:

java.net.ConnectException: No buffer space available (maximum connections reached?): connect

The number of connections by querying netstat (netstat -an | wc -l) during the test has an upper limit of 16489. And then I try the same test on a Windows 2008 server r2 machine, the limit is around 10107.

Is there a limit of open connections on Windows? Or is there anything else that is preventing Gatling to have more sessions?

Any suggestion is appreciated.

Thanks,  
Brian

---

<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:** [March 27, 2015, 9:16am UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/2 "2015-03-27T09:16:02Z")

</div>

[http://serverfault.com/a/249482](http://serverfault.com/a/249482)

---

<div class="post-metadata">

**Author:** ![Brian\_Bo](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brian\_Bo](https://community.gatling.io/u/Brian_Bo)\
**Post date:** [March 27, 2015, 5:02pm UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/3 "2015-03-27T17:02:59Z")

</div>

I read this page while I was Googling for a resolution too… but I ran “net config server” on both my local Win7 and my Windows 2008 server machine, they return the same Maximum open files per session (16384), however, the actual limit when I ran the test was different. (see above)

Also, I don’t find a way to change that number…

Brian

---

<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:** [March 27, 2015, 5:13pm UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/4 "2015-03-27T17:13:35Z")

</div>

You should ask on a Windows forum…

---

<div class="post-metadata">

**Author:** ![Brian\_Bo](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brian\_Bo](https://community.gatling.io/u/Brian_Bo)\
**Post date:** [April 1, 2015, 6:55pm UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/5 "2015-04-01T18:55:14Z")

</div>

After a few days of researching I still have no luck changing the limit on Windows. So I decide to live with it.

However, even if running with 1500 sessions, the number of TCP connections keep going up and eventually hit the upper limit. Why is the connection not closed after the session finishes? I tried to set “allowPoolingConnections = false” and “allowPoolingSslConnections = false” in gatling.conf and it doesn’t seem to help.

Brian

---

<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 1, 2015, 7:13pm UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/6 "2015-04-01T19:13:27Z")

</div>

> However, even if running with 1500 sessions, the number of TCP connections  
> keep going up and eventually hit the upper limit. Why is the connection not  
> closed after the session finishes?

They are closed after the session finishes.

> I tried to set "allowPoolingConnections = false" and  
> "allowPoolingSslConnections = false" in gatling.conf and it doesn't seem to  
> help.

Your issue is probably related to TIME\_WAIT

---

<div class="post-metadata">

**Author:** ![Brian\_Bo](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brian\_Bo](https://community.gatling.io/u/Brian_Bo)\
**Post date:** [April 2, 2015, 1:25am UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/7 "2015-04-02T01:25:20Z")

</div>

I don’t think I made any changes but when I run my script again this afternoon number of TCP connections do not keep increasing anymore… so it could be some issues with the server side (maybe the server didn’t close the connection?)

Anyways, thanks for the help on these topics.

Brian

---

<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 2, 2015, 6:34am UTC](https://community.gatling.io/t/connection-limit-on-windows/2147/8 "2015-04-02T06:34:27Z")

</div>

You should probably check the state of your TCP connections, like those in CLOSE\_WAIT.
