Browse Source

Druid连接池 报错:abandon connection优化

hurugang 2 years ago
parent
commit
d0d95810f1
2 changed files with 4 additions and 4 deletions
  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: