SQL Server连接池(ADO.NET)的不活动时间

问题描述:

什么是不活动"?与SQL Server连接池(ADO.NET)相关的方法
是根据时间决定的吗?如果是,那么如何获得限制?

What does "inactivity" means related to SQL Server Connection Pooling (ADO.NET)
Is it decided based on time ?If yes, then how to get the limit?
and what happenes when the inactivity limit reached?

不活动是基于时间的.经过一定时间后,如果不重新使用池中的连接,则将其关闭.但是,池中保留了许多连接.此连接数量由MinPoolSize控制.

据我所知,没有确切的时间可以使连接在被销毁之前保持不活动状态.根据我的了解,工作量,免费连接的数量等都会影响这一点.

即使没有直接定义闲置时间,对闲置时间也会影响寿命的唯一参数是Connection LifetimeLoad Balance Timeout.
The inactivity is based on time. After certain amount of time a pooled connection is closed if it isn''t reused. However a number of connections are kept in the pool. This amount of connections is controlled by MinPoolSize.

As far as I know there''s no accurate time which the connection can stay inactive before it''s destroyed. As per my understanding the workload, amount of free connections etc affect this.

The only parameters which has an effect to the lifetime regarding inactivity period are Connection Lifetime and Load Balance Timeout even though they directly don''t define the inactivity period.