On 07/05/2024 04:37, Luciano Rodrigues Nunes Mendes wrote:
> Hi Mark,
>
> My application uses Connection Pooling
> <
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-connection-pooling> and there is a timer in it that performs queries every 3 minutes. Would setting the ConnectionIdleTimeout to 15 minutes cause any performance issues?
If a connection is pooled, but not used, it will be idle. The whole
point of a connection pool is to avoid the overhead of creating new
connections, so using a low idle timeout (and I consider 15 minutes to
be low) could conflict with your use of a connection pool: if
connections can be idle in the pool for more than 15 minutes, the
ConnectionIdleTimeout will invalidate those connections. If they do get
checked out from the pool eventually, they will be invalid, and a whole
new connection will need to be established. That assumes the pool is
actually checking validity before returning a connection, otherwise you
might even be confronted with connection errors in your application.
So, first ask yourself *why* you want to set the ConnectionIdleTimeout.
What problem are you trying to solve with it?
Mark
--
Mark Rotteveel