none
What is maximum allowable value of "Max Pool Size" in sql connection string RRS feed

  • Question

  • What is maximum allowable value of "Max Pool Size" in a connection string.

    Suppose this is my connection string in app.config

        <add name="Name" providerName="System.Data.SqlClient" connectionString="Data Source=ServerName;Network Library=DBMSSOCN;Initial Catalog=DatabaseName;user=UserName;password=Password;Max Pool Size=1024;Pooling=true;"/>
    

    What is the "maximum" value i can use instead of "1024". Remember it is maximum value not "default" value.



    Thursday, December 22, 2011 10:04 AM

Answers

  • There is no documented limit on Max Pool Size.   There is however an exact documented limit on maximum number of concurrent connections to a single SQL Server (32767 per instance, see http://msdn.microsoft.com/en-us/library/ms143432.aspx).

     

    A single ADO.NET pool can only go to a single instance, so your maximum effective limit is therefore 32767.

     

    Matt


    Matt
    Saturday, December 24, 2011 7:46 AM
    Moderator

All replies

  • Hi Syed,

    The maximum number of connections allowed in the pool is 100.

    If we try to obtain connections more than max pool size, then ADO.NET waits for Connection Timeout for the connection from the pool. If even after that connection is not available, we get the following exception.

    "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"

     

    Reference : Pooling

    http://www.connectionstrings.com/articles/show/all-sql-server-connection-string-keywords

     

    Hope this helps!


    Every day its a new learning. Keep Learning!!
    If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful

    • Edited by Tiya01 Thursday, December 22, 2011 12:48 PM
    Thursday, December 22, 2011 12:45 PM
  • If you look at my connection string i am using "1024" as pool size. And it works. "1024">"100". Please read my question again. 

    What is maximum allowable value of "Max Pool Size" in a connection string?

    Thursday, December 22, 2011 1:24 PM
  • I would suspect it's either the maximum 32-bit integer value or the SQL Server limit, either of which is far beyond what your system resources would be able to support. Even a max of 1024 is quite large.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, December 22, 2011 2:12 PM
  • I guess no body knows for sure. As far as i know it has not been documented any where. And this is quite irritating.
    Thursday, December 22, 2011 2:22 PM
  • I guess my answer isn't definitive, but the question is academic. You will never approach that limitation on a single server.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, December 22, 2011 3:20 PM
  • There is no documented limit on Max Pool Size.   There is however an exact documented limit on maximum number of concurrent connections to a single SQL Server (32767 per instance, see http://msdn.microsoft.com/en-us/library/ms143432.aspx).

     

    A single ADO.NET pool can only go to a single instance, so your maximum effective limit is therefore 32767.

     

    Matt


    Matt
    Saturday, December 24, 2011 7:46 AM
    Moderator
  • Thanks matt. Appreciate your effort.
    Saturday, December 24, 2011 9:59 AM
  • Syed,

    I know this was a long time ago...

    but

    What did you ever determine is a safe and sensible max pool size? We need to bump ours up a little.

    Tog

    Friday, March 24, 2017 7:10 PM