Lesson Learned #378: What does mean Pool Blocking Period?
Published Jun 21 2023 09:51 AM 1,896 Views

Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod indicates the concept of the "Check Pool Blocking Period," which refers to a period of time during which a check is performed to determine if the connection pool is blocked.

 

A connection pool is a mechanism used in application development to manage and reuse connections to databases. Instead of opening and closing a connection each time there is a need to interact with the database, existing connections are used and stored in a connection pool.

 

During the execution of an application, there may be times when multiple connection requests compete for the resources of the connection pool. If a resource is blocked, it means that a request is waiting for it to be released in order to use it.

 

The "Check Pool Blocking Period" is the interval of time during which a check is performed to determine if the connection pool is blocked.

This check can be performed in various ways, such as inspecting the state of the connection pool resources or conducting a connection test to determine if a new connection can be established without blocking. Depending on the results of the check, different actions can be taken, such as waiting a little longer before retrying the connection or returning an error indicating that the connection pool is blocked.

 

Some other explanations about it:

 

 

It is very important in our retry logic mecanishm to use a correct value instead to connect again in a very short period of time or try to adjust the connection pool size depending on your workload. 

 

"When connection pooling is enabled and a timeout error or other login error occurs, an exception will be thrown and subsequent connection attempts will fail for the next five seconds, the "blocking period". If the application attempts to connect within the blocking period, the first exception will be thrown again. Subsequent failures after a blocking period ends will result in a new blocking period that is

twice as long as the previous blocking period, up to a maximum of one minute.

 

Attempting to connect to Azure SQL databases can fail with transient errors which are typically recovered within a few seconds. However, with the connection pool blocking period behavior, you may not be able to reach your database for extensive periods even though the database is available. This is especially problematic for apps that need to render fast. The PoolBlockingPeriod enables you to select the blocking period best suited for your app. See the PoolBlockingPeriod enumeration for available settings."

 
Enjoy!
Version history
Last update:
‎Jun 21 2023 09:51 AM
Updated by: