When using SpringBoot, tuning around the DB is required, A note about the settings made at that time.
HikariCP is used as the default connection pool.
Change the description of application.yml as follows. The contents changed this time are the time until the connection timeout and the change of the pool size.
spring.datasource.hikari The following part is the target part.
#### **`application.yml`**
```yaml
spring:
  datasource:
    url:[DB connection destination URL]
    username:[DB connection schema]
    password:[DB connection password]
    driverClassName: oracle.jdbc.OracleDriver
    testOnBorrow: true
    validationQuery: SELECT 1 FROM DUAL
    type: com.zaxxer.hikari.HikariDataSource
    hikari:
      connection-timeout: 60000                  # Default: 30000 (30 seconds)
      connection-test-query: SELECT 1 FROM DUAL
      minimum-idle: 50                           # Default: same as maximumPoolSize
      maximum-pool-size: 500                     # Default: 10
It came out as soon as I looked it up, but it was something I didn't know.
If you want to make more detailed settings, the information linked below will be helpful. https://github.com/tokuhirom/java-handbook/blob/master/spring/hikaricp.md
Recommended Posts