Configuring the database connection pool
A connection pool is a cache of database connections maintained so that the connections can be reused when future requests to the database are required. Connection pools significantly reduce overall resource usage. LiveContent Central uses HikariCP, a light-weight, high-performance JDBC connection pool to manage database connections.
Understanding the configurations
- connection-timeout: Defines the maximum time (in milliseconds) that a LiveContent Central service will wait for a connection from the pool. If this time is exceeded without a connection becoming available, an SQL Exception will be thrown. The lowest acceptable connection-timeout is 250ms. Hikari default is 30000 (30 seconds).
- max-lifetime: Sets the maximum lifetime (in milliseconds) for a connection in the pool. An in-use connection will never be retired, only when it is closed will it then be removed. On a connection-by-connection basis, minor negative attenuation is applied to avoid mass extinction in the pool. A value of 0 indicates no maximum lifetime (infinite lifetime), subject to the
idleTimeoutsetting. The minimum allowed value is 30000ms (30 seconds). Hikari default is 1800000 (30 minutes). - keepalive-time: The interval (in milliseconds) in which connections will be tested for aliveness, thus keeping them alive by the act of checking. Hikari default is 0 (disabled).The value must be less than
maxLifetime. - minimum-idle: The minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. If the idle connections dip below this value, HikariCP will make a best effort to restore them quickly and efficiently. Hikari default is 10.
LiveContent Central default settings
| Service Name | connection-timeout | max-lifetime | keepalive-time | minimum-idle |
|---|---|---|---|---|
| Publish Service | 3600000 (i.e, 60 minutes) | 3500000 (i.e, 58 minutes) | 900000 (i.e, 15 minutes) | 10 |
| Deployer Service | 3600000 (i.e, 60 minutes) | 3500000 (i.e, 58 minutes) | 900000 (i.e, 15 minutes) | 10 |
| Distribution Service | 3600000 (i.e, 60 minutes) | 3500000 (i.e, 58 minutes) | 900000 (i.e, 15 minutes) | 10 |
| Discovery Service | 3600000 (i.e, 60 minutes) | 3500000 (i.e, 58 minutes) | 900000 (i.e, 15 minutes) | 1 |
| Content Service | N/A | 60000 (i.e, 1 minute) | N/A | 1 |