0

My application is working like a dream on a couple of boxes. But I am having an issue where I am encountering a pooled connection leak on one environment. Normally the assumption I make is that I am failing to close out the connection somewhere. But if this were the case then I'd be able to replicate the issue. It's connecting from C# asp.net 4 on IIS 7 or 8 to a Microsoft sql server. And every couple of days its running into an issue where I have to restart IIS to sever the connections because it has accumulated over 100(which is set as the max connection pool size). The load on the application is not such that it should ever be reaching that limit, so the only thing I can figure is that there is a leak caused by something particular to this environment related to their configuration.

At first I was thinking that it could be caused by the application running into a separate exception after it had opened the connection but before it had closed it. But this doesn't appear to be the case when I look through the logs, the exception that it cannot create a pooled connection comes out of nowhere.

Is there anything anyone knows of that could lead to this sort of leak maybe a networking issue that is preventing the connection from being closed. Or is there anything that could be misconfigured in IIS or with group policy settings?

OmniBrick
  • 1
  • 1
  • See following : https://www.sqlservercentral.com/blogs/connection-pool-limit-exceeds-error – jdweng Jan 12 '21 at 17:57
  • My guess is (I can only guess because you provided no code) that you forgot to free resources in your code. When using objects of classes that implement IDisposable, you should always dispose them after you are finished using them. So my tip is to check if you disposed all disposable objects after using them. – Xaver Jan 12 '21 at 18:03
  • @Xaver I have had this running on many environments for over 2 years. The same exact code. That is why I am saying that it is not simply an issue of freeing the resources. There is undoubtedly a leak just as you say and the commenter above noted. I ran sp_who2 and it shows 100 inactive open connections from the box with the IIS. I can clear it whenever I want, but the fact that its having the issue in the first place is what I want to know. I am trying to account for reasons I could have this leak on one box and not on the multitude of others. So my mind goes to differences in configuration. – OmniBrick Jan 12 '21 at 19:08
  • Regarding the issue of SqlServer connection leakage, there is a similar post on SO, you can refer to it: https://stackoverflow.com/questions/212596/how-to-detect-sqlserver-connection-leaks-in-a-asp-net-applications – Ding Peng Jan 13 '21 at 06:38

0 Answers0