gpt4 book ai didi

mysql - c3p0 连接池总是达到最大

转载 作者:行者123 更新时间:2023-11-29 19:28:08 26 4
gpt4 key购买 nike

我们正在维护一个已有 5 年历史的 Web 项目,最近我们遇到了登录缓慢的问题。经检查,c3p0 连接池 在用户登录时达到最大。有没有办法调试/修复这个问题?

 Current versions: 
-c3p0:0.9.1.2
-hibernate:3.6.7.Final
-mysql connector: 5.1.23

下面是c3p0设置

<bean id="c3p0PooledMysqlDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="jdbcUrl" value="XX"/>
<property name="user" value="XXXX"/>
<property name="password" value="XXXX"/>
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="acquireIncrement" value="3"/>
<property name="idleConnectionTestPeriod" value="300"/>
<property name="maxIdleTime" value="900"/>
<property name="maxIdleTimeExcessConnections" value="599" />
<property name="maxPoolSize" value="60"/>
<property name="minPoolSize" value="5"/>
<property name="maxStatements" value="0"/>
<property name="testConnectionOnCheckout" value="true"/>
<property name="preferredTestQuery" value="select 1" />
</bean>

日志片段:

Line 315730: 11:06:29,208 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-98) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 317353: 11:06:41,533 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-101) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 317370: 11:06:41,569 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-102) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 317715: 11:06:51,561 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-103) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 317829: 11:06:57,643 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-105) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 317900: 11:07:01,539 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-106) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 318002: 11:07:05,510 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-107) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 318070: 11:07:09,336 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-108) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 318118: 11:07:13,857 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-109) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 318166: 11:07:19,692 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-89) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 318239: 11:07:28,669 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-38) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 318786: 11:08:08,560 DEBUG [com.mchange.v2.resourcepool.BasicResourcePool] (ajp--172.21.66.54-8009-110) acquire test -- pool is already maxed out. [managed: 60; max: 60] Line 3

如有任何帮助,我们将不胜感激。我们已经对此进行了一周多的调试。

最佳答案

检查是否存在连接泄漏。参见例如c3p0 deadlocks in Hibernate或 c3p0 的文档 directly .

哦,请升级到 c3p0 0.9.5.2。 c3p0 0.9.1.x 非常非常老了。

关于mysql - c3p0 连接池总是达到最大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41993984/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com