Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
e4e318aa
Commit
e4e318aa
authored
Feb 01, 2021
by
zhengjie
Browse files
[代码优化](v2.6):druid 配置优化
parent
8fd14d4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/resources/config/application-dev.yml
View file @
e4e318aa
...
@@ -10,19 +10,26 @@ spring:
...
@@ -10,19 +10,26 @@ spring:
# 初始连接数
# 初始连接数
initial-size
:
5
initial-size
:
5
# 最小连接数
# 最小连接数
min-idle
:
1
0
min-idle
:
1
5
# 最大连接数
# 最大连接数
max-active
:
20
max-active
:
30
# 是否自动回收超时连接
remove-abandoned
:
true
# 超时时间(以秒数为单位)
remove-abandoned-timeout
:
180
# 获取连接超时时间
# 获取连接超时时间
max-wait
:
5
000
max-wait
:
3
000
# 连接有效性检测时间
# 连接有效性检测时间
time-between-eviction-runs-millis
:
60000
time-between-eviction-runs-millis
:
60000
# 连接在池中最小生存的时间
# 连接在池中最小生存的时间
min-evictable-idle-time-millis
:
300000
min-evictable-idle-time-millis
:
300000
# 连接在池中最大生存的时间
# 连接在池中最大生存的时间
max-evictable-idle-time-millis
:
900000
max-evictable-idle-time-millis
:
900000
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
test-while-idle
:
true
test-while-idle
:
true
test-on-borrow
:
false
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
test-on-borrow
:
true
# 是否在归还到池中前进行检验
test-on-return
:
false
test-on-return
:
false
# 检测连接是否有效
# 检测连接是否有效
validation-query
:
select
1
validation-query
:
select
1
...
...
eladmin-system/src/main/resources/config/application-prod.yml
View file @
e4e318aa
...
@@ -10,9 +10,9 @@ spring:
...
@@ -10,9 +10,9 @@ spring:
# 初始连接数
# 初始连接数
initial-size
:
5
initial-size
:
5
# 最小连接数
# 最小连接数
min-idle
:
1
0
min-idle
:
1
5
# 最大连接数
# 最大连接数
max-active
:
2
0
max-active
:
3
0
# 获取连接超时时间
# 获取连接超时时间
max-wait
:
5000
max-wait
:
5000
# 连接有效性检测时间
# 连接有效性检测时间
...
@@ -21,8 +21,11 @@ spring:
...
@@ -21,8 +21,11 @@ spring:
min-evictable-idle-time-millis
:
300000
min-evictable-idle-time-millis
:
300000
# 连接在池中最大生存的时间
# 连接在池中最大生存的时间
max-evictable-idle-time-millis
:
900000
max-evictable-idle-time-millis
:
900000
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
test-while-idle
:
true
test-while-idle
:
true
test-on-borrow
:
false
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
test-on-borrow
:
true
# 是否在归还到池中前进行检验
test-on-return
:
false
test-on-return
:
false
# 检测连接是否有效
# 检测连接是否有效
validation-query
:
select
1
validation-query
:
select
1
...
@@ -31,6 +34,7 @@ spring:
...
@@ -31,6 +34,7 @@ spring:
enabled
:
true
enabled
:
true
stat-view-servlet
:
stat-view-servlet
:
enabled
:
true
enabled
:
true
# 控制台管理用户名和密码
url-pattern
:
/druid/*
url-pattern
:
/druid/*
reset-enable
:
false
reset-enable
:
false
login-username
:
admin
login-username
:
admin
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment