# MS SQL keeps randomly faulting, gateway disconnecting randomly

**URL:** <https://forum.inductiveautomation.com/t/ms-sql-keeps-randomly-faulting-gateway-disconnecting-randomly/23356>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [March 14, 2019, 7:49pm UTC](https://forum.inductiveautomation.com/t/ms-sql-keeps-randomly-faulting-gateway-disconnecting-randomly/23356 "2019-03-14T19:49:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 30, 2020, 9:19pm UTC](https://forum.inductiveautomation.com/t/ms-sql-keeps-randomly-faulting-gateway-disconnecting-randomly/23356/5 "2020-10-30T21:19:18Z")

</div>

From this line:

```plaintext
Cannot get a connection, pool error Timeout waiting for idle object

```

This exception is stating that the pool manager cannot produce a viable connection to a waiting requester and the maxWait has passed therefore triggering a timeout. Usually the issue falls into two broad categories:

1. The DB is down or unreachable. This could be because you forgot to start it, or it crashed, or the network between you and the DB has stopped working.

2. The connection pool is out of connections. This could be due to high demand, or it could be an indication of a connection leak where connections are never returned to the pool and eventually you exceed the max connections limit.

> [@Using Perfmon to find bottlenecks in SQL Server](http://forum.inductiveautomation.com/t/using-perfmon-to-find-bottlenecks-in-sql-server/3826):
>
> The information below is to be used as a guide. Just because the counters collected in your environment may be drastically different from those listed below does not mean that there is a problem. I am sure many of these could be debated but I find the information helpful and you can be the judge if it is useful in your environment(s). I am not the author of the content below so if you see something that you disagree with… don't blame me! slight_smile Memory Bottleneck Analysis Object: - Memo…

---

_[View the full topic](https://forum.inductiveautomation.com/t/ms-sql-keeps-randomly-faulting-gateway-disconnecting-randomly/23356)._
