0

Last night I doubled the processor cores (CPUs) on my web server from 4 to 8 to speed up a download process from an API which worked perfectly.

This caused an error in a different API on the same server: "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."

When checking for open connections in SQL Server I can see it slowly creep up to 100, closing a few connections along the way and then the error starts showing as a response from the API once it hits 100.

These 2 APIs have been running perfectly fine (slowly) on 4 cores for 3 years, why would adding 4 more cores cause this to happen?

I do see potential leakage in the form of opening DataReaders but if an error occurs not closing them but ending the request and sending a response to the client, but why would this not have happened on half the amount of cores?

The only thing that makes the error go away is restarting the Application Pool in IIS

Bill
  • 1

1 Answers1

0

Doubling CPU units clearly boost paralleled jobs, so pooled resources are more likely to be exhausted. Thus, not a surprise to see the exception you talked about.

If you cannot fix code smells right now, then use a larger limit might help, Should I set max pool size in database connection string? What happens if I don't?

Lex Li
  • 60,503
  • 9
  • 116
  • 147