Skip to content

Commit 1479f82

Browse files
author
Janche
committed
🚀 更新2.1boot的Druid配置
1 parent 65a7504 commit 1479f82

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

web/src/main/resources/application-dev.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ server:
44
# session失效时间
55
servlet:
66
session:
7-
timeout: 36000s
7+
timeout: 7200s
88

99
spring:
1010
profiles:
11-
include: errorcode,sysconfig
11+
include: sysconfig
1212
#json数据 日期 格式化
1313
jackson:
1414
date-format: "yyyy-MM-dd HH:mm:ss"
@@ -22,27 +22,28 @@ spring:
2222

2323
# Druid连接池配置
2424
type: com.alibaba.druid.pool.DruidDataSource
25-
# 初始化
26-
initialSize: 3
27-
# 最大
28-
maxActive: 20
29-
# 最小
30-
minIdle: 3
31-
# 最大连接等待超时时间
32-
maxWait: 60000
33-
# 打开PSCache,并且指定每个连接PSCache的大小
34-
poolPreparedStatements: true
35-
maxPoolPreparedStatementPerConnectionSize: 20
36-
validationQuery: select 'x'
37-
testWhileIdle: true
38-
testOnBorrow: false
39-
testOnReturn: false
40-
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
41-
timeBetweenEvictionRunsMillis: 60000
42-
# 配置一个连接在池中最小生存的时间,单位是毫秒
43-
minEvictableIdleTimeMillis: 300000
44-
# 配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
45-
filters: stat, wall, log4j
25+
druid:
26+
# 初始化
27+
initialSize: 3
28+
# 最大
29+
maxActive: 20
30+
# 最小
31+
minIdle: 3
32+
# 最大连接等待超时时间
33+
maxWait: 60000
34+
# 打开PSCache,并且指定每个连接PSCache的大小
35+
poolPreparedStatements: true
36+
maxPoolPreparedStatementPerConnectionSize: 20
37+
validationQuery: select 'x'
38+
testWhileIdle: true
39+
testOnBorrow: false
40+
testOnReturn: false
41+
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
42+
timeBetweenEvictionRunsMillis: 60000
43+
# 配置一个连接在池中最小生存的时间,单位是毫秒
44+
minEvictableIdleTimeMillis: 300000
45+
# 配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
46+
filters: stat, wall, slf4j
4647

4748
# http
4849
http:

0 commit comments

Comments
 (0)