浏览代码

Druid连接池 报错:abandon connection优化

hurugang 2 年之前
父节点
当前提交
d0d95810f1
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      src/main/resources/application-dev.yml
  2. 2 2
      src/main/resources/application-prod.yml

+ 2 - 2
src/main/resources/application-dev.yml

@@ -79,8 +79,8 @@ spring:
       max-pool-prepared-statement-per-connection-size: 200
       #对于长时间不使用的连接强制关闭
       remove-abandoned: true
-      #数据库链接超过3分钟开始关闭空闲连接 秒为单位
-      remove-abandoned-timeout: 180
+      #数据库链接超过30分钟开始关闭空闲连接 秒为单位
+      remove-abandoned-timeout: 1800
       #将当前关闭动作记录到日志  此配置项会影响性能,只在排查的时候打开,系统运行时最好关闭。
       log-abandoned: true
   autoconfigure:

+ 2 - 2
src/main/resources/application-prod.yml

@@ -79,8 +79,8 @@ spring:
       max-pool-prepared-statement-per-connection-size: 200
       #对于长时间不使用的连接强制关闭
       remove-abandoned: true
-      #数据库链接超过3分钟开始关闭空闲连接 秒为单位
-      remove-abandoned-timeout: 180
+      #数据库链接超过30分钟开始关闭空闲连接 秒为单位
+      remove-abandoned-timeout: 1800
       #将当前关闭动作记录到日志
       log-abandoned: true
   autoconfigure: