-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapplication-common.yml
41 lines (41 loc) · 1.85 KB
/
application-common.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
spring:
datasource:
driver-class-name: org.postgresql.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 池中某个连接的空闲时长达到 N 毫秒后, 连接池在下次检查空闲连接时,将回收该连接
min-evictable-idle-time-millis: 300000
# 检测超时
validation-query-timeout: 1
validation-query: SELECT 1
# 申请连接时检测有效,影响性能
test-on-borrow: false
# 归还连接时检测有效,影响性能
test-on-return: false
# 循环检测有效,不影响性能
test-while-idle: true
# 检查空闲连接的频率,单位毫秒
time-between-eviction-runs-millis: 10000
# 是否缓存preparedStatement, mysql下关闭,支持游标的数据库开启
pool-prepared-statements: true
# 缓存preparedStatement大小,开启后建议100,-1关闭
max-pool-prepared-statement-per-connection-size: 100
async-init: false
filter:
# 开启druiddatasource的状态监控
stat:
enabled: true
db-type: postgresql
log-slow-sql: true
slow-sql-millis: 1000
connection-stack-trace-enable: true
########## 配置WebStatFilter,用于采集web关联监控的数据 ##########
web-stat-filter:
enabled: true # 启动 StatFilter
url-pattern: /* # 过滤所有url
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" # 排除一些不必要的url
session-stat-enable: false # 开启session统计功能
########## 配置StatViewServlet(监控页面),用于展示Druid的统计信息 ##########
stat-view-servlet:
enabled: true # 启用StatViewServlet
reset-enable: true # 不允许清空统计数据,重新计算