PlayFramework 2.5:HikariCP忽略application.conf中的一些(但不是全部)设置

PlayFramework 2.5:HikariCP忽略application.conf中的一些(但不是全部)设置,playframework,hikaricp,Playframework,Hikaricp,我对PlayFramework2.5中HikariCP的配置有点困惑 我将其添加到我的application.conf文件中: play.db { # The combination of these two settings results in "db.default" as the # default JDBC pool: config = "db" default = "default" # Play uses HikariCP as the default co

我对PlayFramework2.5中HikariCP的配置有点困惑

我将其添加到我的
application.conf
文件中:

play.db {
  # The combination of these two settings results in "db.default" as the
  # default JDBC pool:
  config = "db"
  default = "default"  
  # Play uses HikariCP as the default connection pool.  You can override
  # settings by changing the prototype:
  prototype {
    hikaricp.maximumPoolSize = 30
    hikaricp.connectionTimeout = 5 seconds
    hikaticp.maxLifetime = 10 seconds
    hikaticp.idleTimeout = 5 seconds
  }
}

db.default.driver=org.postgresql.Driver
db.default.url=${?JDBC_DATABASE_URL}
db.default.username=${?DATABASE_USERNAME}
db.default.password=${?DATABASE_PASSWORD}
那很好。我与数据库建立了连接,可以提交查询和所有信息。我的问题是,只使用了HikariCP设置的一部分。在应用程序开始时,我捕获使用的HikariCP参数:

[ 2017-02-23 11:12:58,413 ] [info] application - Creating Pool for datasource 'default'
[ 2017-02-23 11:12:58,424 ] [debug] c.z.h.HikariConfig - HikariPool-1 - configuration:
[ 2017-02-23 11:12:58,430 ] [debug] c.z.h.HikariConfig - allowPoolSuspension.............false
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - autoCommit......................true
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - catalog.........................null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - connectionInitSql...............null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - connectionTestQuery.............null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - connectionTimeout...............5000
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - dataSource......................null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - dataSourceClassName.............null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - dataSourceJNDI..................null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - dataSourceProperties............{password=<masked>}
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - driverClassName................."org.postgresql.Driver"
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - healthCheckProperties...........{}
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - healthCheckRegistry.............null
[ 2017-02-23 11:12:58,431 ] [debug] c.z.h.HikariConfig - idleTimeout.....................600000
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - initializationFailFast..........true
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - isolateInternalQueries..........false
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - jdbc4ConnectionTest.............false
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - jdbcUrl........................."XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - leakDetectionThreshold..........0
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - maxLifetime.....................1800000
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - maximumPoolSize.................30
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - metricRegistry..................null
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - metricsTrackerFactory...........null
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - minimumIdle.....................30
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - password........................<masked>
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - poolName........................"HikariPool-1"
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - readOnly........................false
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - registerMbeans..................false
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - scheduledExecutorService........null
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - threadFactory...................null
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - transactionIsolation............null
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - username........................"XXXXXXXXXXXXXXXX"
[ 2017-02-23 11:12:58,432 ] [debug] c.z.h.HikariConfig - validationTimeout...............5000
[2017-02-23 11:12:58413][info]应用程序-为数据源“默认”创建池
[2017-02-23 11:12:58424][debug]c.z.h.HikariConfig-HikariPool-1-配置:
[2017-02-23 11:12:58430][debug]c.z.h.HikariConfig-allowPoolSuspension
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-自动提交
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-目录为空
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-connectionInitSql
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-connectionTestQuery……….空
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-连接超时5000
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-数据源空
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-dataSourceClassName……….空
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-dataSourceJNDI
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-dataSourceProperties………{password=}
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-drivercassname………….“org.postgresql.Driver”
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-healthCheckProperties
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-healthCheckRegistry
[2017-02-23 11:12:58431][debug]c.z.h.HikariConfig-idleTimeout 600000
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-初始化失败快速……….正确
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-isolateInternalQueries错误
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-jdbc4连接测试错误
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-jdbcUrl.“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-泄漏检测阈值
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-maxLifetime 1800000
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-maximumPoolSize
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-metricRegistry
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-metricsTrackerFactory……….空
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-minimumIdle
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-密码。。。。。。。。。。。。。。。。。。。。。。。。
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-poolName.“HikariPool-1”
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-只读错误
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-registerMbeans
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-scheduledExecutorService…….null
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-螺纹工厂空
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-交易分离…………空
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-用户名“XXXXXXXXXXXXXX”
[2017-02-23 11:12:58432][debug]c.z.h.HikariConfig-验证超时
maximumPoolSize
connectionTimeout
的值在
application.conf
中设置。但是
maxlifest
idleTimeout
的值将被忽略并设置为其他值


application.conf
的语法在某些方面是否有错误,我看不到错误?

它们非常小,请尝试设置5分钟左右

现在,您必须在日志中看到类似的消息

maxLifetime is less than 30000ms, using default 1800000ms.
该代码来自以下源代码:


谢谢类似于变量的最小值的东西也出现在我的脑海中,但我还没有找到这方面的提示。此外:应用程序的真正问题是连接处理不好,导致连接池在短时间内没有可用连接。解决该问题后,我们不需要如此短的maxLifetime值。
LOGGER.warn("{} - maxLifetime is less than 30000ms, setting to default {}ms.", poolName, MAX_LIFETIME);
...
LOGGER.warn("{} - idleTimeout is less than 10000ms, setting to default {}ms.", poolName, IDLE_TIMEOUT);