How to reset connection pool in Azure (Error: max pool size was reached)?

12,208

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:
12,208

Related videos on Youtube

TruMan1
Author by

TruMan1

Updated on September 18, 2022

Comments

  • TruMan1
    TruMan1 over 1 year

    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?

  • Cory Knutson
    Cory Knutson about 5 years
    Welcome to ServerFault. Answers should have an explaination behind them on what and how the command fixes the issue. serverfault.com/help/how-to-answer
  • mslot
    mslot almost 5 years
    What are my max connections? Max concurrent sessions or Max concurrent workers (requests)?