# close\_wait connections going up on Tomcat

**URL:** <https://community.dynatrace.com/t/close-wait-connections-going-up-on-tomcat/20488>\
**Category:** Open Q&A\
**Tags:** java\
**Created:** [April 29, 2019, 8:36pm UTC](https://community.dynatrace.com/t/close-wait-connections-going-up-on-tomcat/20488 "2019-04-29T20:36:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hans\_hofkens](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hans\_hofkens](https://community.dynatrace.com/u/hans_hofkens)\
**Post date:** [April 29, 2019, 8:36pm UTC](https://community.dynatrace.com/t/close-wait-connections-going-up-on-tomcat/20488/1 "2019-04-29T20:36:15Z")

</div>

We have a few servers where we see close\_wait connections piling up until we reached the limit. As I understood that the application should close the close\_wait sockets I suspect this to be an application issues. I can’t find anything in the code execution indicating that nor do I something suspicious in Dynatrace that would warn us.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [July 24, 2020, 2:46pm UTC](https://community.dynatrace.com/t/close-wait-connections-going-up-on-tomcat/20488/2 "2020-07-24T14:46:38Z")

</div>

you could put in a custom detection for that string of close\_warn and Dynatrace will alert you. This method can also be done at a log standpoint as well.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [July 24, 2020, 2:48pm UTC](https://community.dynatrace.com/t/close-wait-connections-going-up-on-tomcat/20488/3 "2020-07-24T14:48:45Z")

</div>

> **[Custom alerts](https://docs.dynatrace.com/docs/dynatrace-intelligence/root-cause-analysis/event-analysis-and-correlation/event-categories/custom-alerts)**
>
> Learn more about custom alerts and the logic behind raising them.

---

<div class="post-metadata">

**Author:** ![Joe\_Hoffman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joe_hoffman/32/30752_2.png) [@Joe\_Hoffman](https://community.dynatrace.com/u/Joe_Hoffman)\
**Post date:** [July 24, 2020, 3:13pm UTC](https://community.dynatrace.com/t/close-wait-connections-going-up-on-tomcat/20488/4 "2020-07-24T15:13:01Z")

</div>

Close\_wait()'s can pile up when a TCP connection gets closed from the other end and leaves your end dangling. So perhaps it would be helpful to track the call tree of the close wait threads AND track the remote endpoint. This might give you visibility into a pattern of loosing connections to a common remote endpoint which is really the root cause.
