[英]apache-commons-dbcp connection pooling maxActive parameter
We are using Apache DBCP 1.4 for database connection pooling, with Java back-end, in our application.我们在我们的应用程序中使用 Apache DBCP 1.4 进行数据库连接池,带有 Java 后端。 We set the value for maxActive = 20(by default), there was a scenario where requests needed more than 20 connection for execution.我们将 maxActive 的值设置为 20(默认情况下),有一个场景是请求需要超过 20 个连接才能执行。 At that time application gets hang/unresponsive.那时应用程序挂起/无响应。
I have increased the value to maxActive = 50. Then execution completes successfully.我已将值增加到 maxActive = 50。然后执行成功完成。 In documentation of Apache DBCP, I have seen we can put the value of maxActive = -1, and this will not set upper limit on connection creation.在Apache DBCP的文档中,我看到我们可以设置maxActive = -1的值,这不会设置连接创建的上限。 Can I set maxActive = -1, if not can you please help me understand why it is not desirable and also what can be descent value we can set for maxActive so that my application do not gets hang/unresponsive.我可以设置 maxActive = -1,如果不是,请帮助我理解为什么它是不可取的,以及我们可以为 maxActive 设置的下降值是什么,这样我的应用程序就不会挂起/无响应。
Motivations to limit the number of connections in a db-Pool限制 db-Pool 中连接数的动机
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.