Connection pool timeout

Issue

When there is an increase in the number of requests made to the server, some connections get a timeout error and are not processed. 

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.

Environment

DNN - All versions

Root Cause

The maximum number of connections configured in the server is reached, causing rejection to all new connections. This limit is usually reached due to a high number of intensive queries with a long completion time. 

Note: The default number of connections configured on the server is 100.  

Resolution 

  1. Confirm that you are having a connection pool timeout issue by searching for the error described in the issue section in the following log file: 
    website_folder/Portals/_default/logs/[DATE LOG]
    ss.png


  2. If the error was found, open the web.config file located in the website root folder. 
  3. Add the parameter Max Pool Size=XXX in the connection string, replacing XXX for your desired value. 

    Your connection string should look like this if XXX= 200. 
    <connectionStrings>
    <add name="SiteSqlServer" connectionString="Data Source=localhost;Initial Catalog=dbname;User ID=dbuser;Password=dbpassword;Max Pool Size=200" providerName="System.Data.SqlClient" />
    </connectionStrings>
  4. Monitor the system logs mentioned in step 1 to confirm that the error is no longer appearing after the change. 

 

Comments

0 comments

Please sign in to leave a comment.