本文介绍了为什么我们需要设置闵池大小的ConnectionString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关SQL连接池,为什么我们需要建立一个分池的大小?作为连接将被保存在连接池和重用,为什么我们需要保持在最小池大小指定活动连接?谢谢你。

For SQL connection pool, why do we need to set up a min pool size? As connections will be saved in the connection pool and reused, why do we need to keep live connections specified by the min pool size? Thanks.

推荐答案

打开和保持连接是昂贵的,所以如果你知道你需要多个连接(总是)这是更好地指定在了MinPoolSize 因为当时它确保了这些连接都可用。

Opening and maintaining connections is expensive, so if you know that you need multiple connections (always) it's better to specify the MinPoolSize because then it's ensured that these connections are available.

另外,从:

如果了MinPoolSize 是不是连接字符串中指定或
中规定为零,在池中的连接将不活动的一个
段之后关闭。但是,如果指定的了MinPoolSize 大于
大于零,连接池的不被破坏,直到应用程序域为
卸载,过程结束
。非活动或空池
的维护包括最小的系统开销。

这篇关于为什么我们需要设置闵池大小的ConnectionString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 18:25
查看更多