in

Drowning In Technical Debt

C# | ASP.NET | SharePoint | SQL | Architecture | SOA |

David Strommer

Connection Pool timeout expired

A few days ago, we began to receive the following error - System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

Of course, two days before production release we began to receive the error above.  We could not reproduce under stressed conditions. The error occurred without any recognizable pattern and manual code reviews turned up empty. We opened a support call with MS and discovered the following:

.Net 2.0 introduced a new PerfMon counter – NumberOfReclaimedConnections. The counter indicates the # of connections that have been reclaimed through garbage collection where Close or Dispose was NOT CALLED by the application code.

Other ADO.Net counters - http://msdn2.microsoft.com/en-US/library/ms254503.aspx

We eventually found the code (off shore code that missed a code review).

Published Nov 10 2006, 01:06 PM by David Strommer
Filed under:

Comments

 

Dennis J. Bottjer said:

Perhaps Garbage Collection is spoiling us as developers. The Garbage Collector is kind of like our own maid following us around picking up every mess we create. Anway, .NET does a great job managing many resources for us including things like memory and

November 14, 2006 12:43 AM
 

David Strommer said:

Several months ago I posted about a NumberOfReclaimedConnections performance counter. http://drowningintechnicaldebt

May 26, 2007 3:40 PM
 

David Strommer said:

Several months ago I posted about a NumberOfReclaimedConnections performance counter. drowningintechnicaldebt.com/.../Connection-Pool-timeout-expired.aspx...

May 26, 2007 3:40 PM
Powered by Community Server (Commercial Edition), by Telligent Systems