Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running IIS on Server 2008 R2. Recently, I've seen a lot of errors like this:

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.

When I go into the IIS manager and look at the worker processes, I see that this application pool has a bunch of requests that have been running for over an hour each. I'm guessing that they're holding on to db connections, which is why nobody else can get one.

So, two questions:

  1. Why didn't IIS timeout and kill off these requests? (They normally complete in 1 - 2 seconds.)
  2. How do I make sure this doesn't happen?


share|improve this question

IIS isn't making those database connections, your app is.

You need to troubleshoot the issue according to the application framework you're using (from the look of it, I'd guess .Net with connection pooling) - I'd guess you're leaking connections, possibly due to not cleaning up properly (calling Close or Dispose) or having some weird exception handling code that forgets to clean up.

IIS can't magically do that because your app hasn't indicated that it's finished performing work - IIS doesn't know if the database is slow or the exception handler isn't cleaning up properly, it just knows it started a request at point X, and it hasn't returned so it might still be busy.

Some apps use incredibly long-running connections and don't respond positively to having the connection terminated forcibly.

share|improve this answer
In addition, if you use .NET or another "iis optimized language" then every request does not spawn another process - so the connection is opened somewhere in the app pool which is YOUR responsibility. And "requests frunning for hours" smells a lot like "broken programming" or "totally ridiculous too slow hardware" (but really on a ridiculous level, like a small VM instead of a quad xeon machine). I would start fixing things from that side (i.e. finding out WHY They run for hours). – TomTom Aug 17 '13 at 17:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.