Commit e3d7be9d819e5d5fbb072103c06b4f1d0f00a5e2
Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0
Showing
2 changed files
with
9 additions
and
19 deletions
src/main/resources/application-dev.yml
| @@ -18,29 +18,19 @@ spring: | @@ -18,29 +18,19 @@ spring: | ||
| 18 | timeout: 10000 | 18 | timeout: 10000 |
| 19 | # mysql数据源 | 19 | # mysql数据源 |
| 20 | datasource: | 20 | datasource: |
| 21 | - type: com.alibaba.druid.pool.DruidDataSource | 21 | + type: com.zaxxer.hikari.HikariDataSource |
| 22 | driver-class-name: com.mysql.cj.jdbc.Driver | 22 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 23 | url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true | 23 | url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true |
| 24 | username: root | 24 | username: root |
| 25 | password: 123456 | 25 | password: 123456 |
| 26 | - druid: | 26 | + hikari: |
| 27 | + connection-timeout: 20000 # 是客户端等待连接池连接的最大毫秒数 | ||
| 27 | initialSize: 10 # 连接池初始化连接数 | 28 | initialSize: 10 # 连接池初始化连接数 |
| 28 | - maxActive: 200 # 连接池最大连接数 | ||
| 29 | - minIdle: 5 # 连接池最小空闲连接数 | ||
| 30 | - maxWait: 60000 # 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置useUnfairLock属性为true使用非公平锁。 | ||
| 31 | - keepAlive: true # 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作。 | ||
| 32 | - validationQuery: select 1 # 检测连接是否有效sql,要求是查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。 | ||
| 33 | - testWhileIdle: true # 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 | ||
| 34 | - testOnBorrow: false # 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 | ||
| 35 | - testOnReturn: false # 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 | ||
| 36 | - poolPreparedStatements: false # 是否開啟PSCache,並且指定每個連線上PSCache的大小 | ||
| 37 | - timeBetweenEvictionRunsMillis: 60000 # 配置間隔多久才進行一次檢測,檢測需要關閉的空閒連線,單位是毫秒 | ||
| 38 | - minEvictableIdleTimeMillis: 300000 # 配置一個連線在池中最小生存的時間,單位是毫秒 | ||
| 39 | - filters: stat,slf4j # 配置监控统计拦截的filters,监控统计用的filter:sta, 日志用的filter:log4j | ||
| 40 | - useGlobalDataSourceStat: true # 合并多个DruidDataSource的监控数据 | ||
| 41 | - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 | ||
| 42 | - connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=1000 | ||
| 43 | - #stat-view-servlet.url-pattern: /admin/druid/* | 29 | + maximum-pool-size: 200 # 连接池最大连接数 |
| 30 | + minimum-idle: 5 # 连接池最小空闲连接数 | ||
| 31 | + idle-timeout: 300000 # 允许连接在连接池中空闲的最长时间(以毫秒为单位) | ||
| 32 | + max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位) | ||
| 33 | + | ||
| 44 | 34 | ||
| 45 | #[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 | 35 | #[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 |
| 46 | server: | 36 | server: |
src/main/resources/application-docker.yml
| @@ -23,7 +23,7 @@ spring: | @@ -23,7 +23,7 @@ spring: | ||
| 23 | url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&allowMultiQueries=true | 23 | url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&allowMultiQueries=true |
| 24 | username: root | 24 | username: root |
| 25 | password: root | 25 | password: root |
| 26 | - type: com.alibaba.druid.pool.DruidDataSource | 26 | + type: com.zaxxer.hikari.HikariDataSource |
| 27 | driver-class-name: com.mysql.cj.jdbc.Driver | 27 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 28 | 28 | ||
| 29 | # [可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 | 29 | # [可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 |