Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am getting the below error in my Azure website and am scrambling to fix it:

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: 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.

How can I reset the pool or increase it?

share|improve this question

2 Answers 2

You can increase the SQL Connection Pool in Azure the same was as any other database. By default you get 100 connections. If you don't have that many users on your system you may want to check that you are closing/disposing connections when they're no longer in use.

connectionString="Server=XXX;Database=XXX;User Id=XXX;password=XXX;
    connection timeout=0;Max Pool Size = 500;Pooling = True"
share|improve this answer

You can run a startup command to change the app pool idle timeout. Run something like this from a cmd file called from a Startup task (this example disables timeout):

%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00

Using a similar technique, you can recycle the app pool after hitting a certain memory threshold (see this article)

share|improve this answer

Your Answer

 
discard

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.