tomcat 连接池泄露的有关问题:Cannot get a connection, pool exhausted
tomcat 连接池泄露的问题:Cannot get a connection, pool exhausted1 问题描述Web程序在tomcat刚开始运行
tomcat 连接池泄露的问题:Cannot get a connection, pool exhausted
1 问题描述
Web程序在tomcat刚开始运行时速度很快,但过一段时间后发现速度变得很慢。
检查日志输出,发现异常如下:
<parameter><name>logAbandoned</name><value>true</value></parameter>
附 spring配置 BasicDataSource的相关参数解释
1 初始化连接
initialSize=10
2 最大空闲连接
maxIdle=20
3 最小空闲连接
minIdle=5
4 最大连接数量
maxActive=50
5 是否在自动回收超时连接的时候打印连接的超时错误
logAbandoned=true
6 是否自动回收超时连接
removeAbandoned=true
7 超时时间(以秒数为单位)
removeAbandonedTimeout=180
8 超时等待时间以毫秒为单位 6000毫秒/1000等于60秒
maxWait=1000