oracle 最大连接池大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5793960/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 23:29:02  来源:igfitidea点击:

Maximum Connection Pool Size

sql-serverdatabaseoracledatabase-connectionconnection-pooling

提问by Vicky

I came across below text while reading about Database Connection pool properties:

我在阅读有关数据库连接池属性的内容时遇到了以下文本:

The maximum pool sizeproperty specifies the maximum number of available and borrowed (in use) connections that a pool maintains. If the maximum number of connections are borrowed, no connections will be available until a connection is returned to the pool. This property allows the number of connections in the pool to increase as demand increases. At the same time, the property ensures that the pool doesn't grow to the point of exhausting a system's resources,which ultimately affects an application's performance and availability.

maximum pool size属性指定池维护的最大可用连接数和借用(使用中)连接数。如果借用了最大数量的连接,则在连接返回到池之前将没有连接可用。此属性允许池中的连接数随着需求的增加而增加。同时,该属性确保池不会增长到exhausting a system's resources,最终影响应用程序性能和可用性的程度。

My Question is: When above text talk about 'exhausting system resources' does that mean degrading performance of Database? If answer is yes, why not databases have maximum connection limit that it can withstand without compromising with performance rather than relying on applications to specify proper maximum connection limit? Is there anything in database that says how much concurrent connection it can supports (say for Oracle/SQL Server?)

我的问题是:当上面的文字谈论“ exhausting system resources”时,这是否意味着降低数据库的性能?如果答案是肯定的,为什么数据库没有它可以承受的最大连接限制而不影响性能,而不是依赖应用程序来指定适当的最大连接限制?数据库中是否有任何内容表明它可以支持多少并发连接(例如 Oracle/SQL Server?)

采纳答案by Justin Cave

In general, the concern about "exhausting system resources" applies to both the application server and the database server. The more database connections you allow, the more concurrent sessions are running on the application server(s), the more RAM the application server(s) VM requires, the more demand is placed on CPUs on application servers and database servers, etc. If the queue of backlogged work gets too big, you may find yourself spending more time swapping processes on and off the CPU and scheduling tasks than in doing useful work. A maximum size on the connection pool allows you to handle an avalanche of traffic or an unexpected performance bottleneck slightly more gracefully by quickly erroring out rather than letting users time out waiting for replies that will never come.

一般来说,对“耗尽系统资源”的担忧适用于应用服务器和数据库服务器。您允许的数据库连接越多,应用服务器上运行的并发会话就越多,应用服务器 VM 需要的 RAM 越多,对应用服务器和数据库服务器等的 CPU 的需求就越大。如果积压的工作队列变得太大,您可能会发现自己花费更多的时间在 CPU 上下交换进程和调度任务,而不是做有用的工作。连接池的最大大小允许您通过快速出错而不是让用户超时等待永远不会到来的回复来更优雅地处理雪崩式的流量或意外的性能瓶颈。

Databases do, in general, have the ability to limit the number of connections they support. Oracle has PROCESSESand SESSIONSparameters, for example, and supports multiple connection architectures (dedicated server and shared server) to let you trade off performance against resource consumption to increase the number of concurrent connections the database can support.

一般来说,数据库确实有能力限制它们支持的连接数。例如,Oracle 有PROCESSESSESSIONS参数,并支持多种连接架构(专用服务器和共享服务器),让您可以在性能与资源消耗之间进行权衡,以增加数据库可以支持的并发连接数。