SQL SERVER (express) 中的连接池 - 推荐数量?
我的每个应用程序与连接池一起使用时是否有建议的连接量..,我的应用程序在“同一”服务器上使用 asp.net 和 c# 来对抗 sql express。
我有 5 个应用程序正在运行,它们没有被密集使用,所有连接都打开和关闭。
所以我正在考虑将每个应用程序设置为最小池 = 5
所以这个 5 x 5 = 25
sql Express 可以处理 25 个连接...实际上有 5 个池,每个池有 5 个连接?
我可以升到十吗?是否有必要将 MAX 池属性放入连接字符串中以确保我不会超过每个池的数字?
任何帮助真的很感激
is there a recommended amount of connections fro each application i have for use with connection pooling.., my apps are using asp.net and c# against sql express on the "same" server.
I have 5 applications running, they are not used intensively, all connections are opened and closed..
So i was thinking of setting each app to have min pool = 5
so this 5 x 5 = 25
Can sql express handle 25 connection ... well actually 5 pools and 5 connections each pool?
Could i go up to ten? And is it necessary to put MAX pool property in the connection string to ensure i don't go over a number per pool?
Any help really apprecaited
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
连接数量并不重要。您可以将连接池大小设置为默认值 100。
重要的是请求数量。 SQL Express 的限制之一是它只能运行一个调度程序 ,因此实际上它只使用一个 CPU 核心。这限制了可以处理的请求数量。没有硬性限制,只是在您开始注意到应用程序性能下降之前,一个 CPU 核心只能处理一定量的工作(请求需要更长的时间才能完成)。
Express 的第二个重要限制是最大 1 GB 缓冲池大小 。这限制了可以缓存的数据量和过程缓存的大小。结果是更短的页面内存寿命和更高的 I/O,以及更频繁的计划编译。所有这些再次导致性能逐渐下降。
正如您在 SQL Express 中看到的那样,没有达到硬限制,它就会停止工作,只是它分配的硬件资源受到限制,结果是整体吞吐量有限。当接近吞吐量限制时,性能开始下降。
在旧版本的 MSDE 上,查询限制为 5 个并发请求,在第 6 个请求时,MSDE 引擎会人为地减慢自身速度。
The number of connections does matter little. You can let the connection pool size at the default 100.
What matters is the number of requests. One of the limitations of SQL Express is that it only runs one scheduler, so in effect it utilizes only one CPU core. This limits the number of requests that can be processed. There is no hard limit, is just that the one CPU core will be able to handle only a certain amount of work before you start noticing performance degradation in your applications (requests take longer to complete).
The second important limitation of Express is the 1 GB max buffer pool size. This limits the amount of data that can be cached and the size of the procedure cache. The result is shorter page in-memory lifetime and higher I/O, as well as more often compilations of plans. All these again contribute to gradual performance degradation.
As you see with SQL Express there is no hard limit you reach and it stops working, is just that is constrained in what hardware resources it allocates and the result is a limited overall throughput. As you approach that throughput limit, performance start to degrade.
On the older version MSDE there was a query limit of 5 concurrent requests, on the 6th requests the MSDE engine would artificially slow itself down.
这取决于您使用的 SQL Server 版本,但对于 SQL Server 2005 Express,连接没有限制,所以应该没问题。
此处指出了这些限制
It will depend on what version of sql server you're using, but for SQL Server 2005 express there is no limitation on connections, so you should be fine.
The limitations are indicated here
理论上,SQL Express 可以处理与其老大哥 SQL Server 相同数量的连接,即 32,767 个。然而... SQL Express 在达到该数字之前就会遇到内存限制,因为它仅限于使用 1 GB RAM。
SQL Express can handle the same amount of connections in theory as it's big brother SQL Server, which is 32,767. However ... SQL Express would run into it's memory limit far before it'd ever get to that number since it's limited to using 1 GB of RAM.