HikariCP pool sizing for elastic cloud deployments in JHipster
0 reputation · 03 Sept 2020, 12:09 UTC
0 reputation · 03 Sept 2020, 12:09 UTC
JHipster leverages HikariCP as the default connection pool provider, integrating closely with Spring Boot's externalized configuration. In highly elastic cloud environments, the application must balance rapid scaling of container instances against the fixed connection limits of the underlying database.
Current configurations often rely on a static maximumPoolSize and minimumIdle. However, when instances scale rapidly, a high minimumIdle across many pods can lead to database-side resource exhaustion, while a too-low limit may cause request queuing during traffic spikes.
Given the transition toward Spring Boot 3.x standards, there is uncertainty regarding the optimal relationship between these two properties to maintain stability during aggressive auto-scaling events.
minimumIdle and maximumPoolSize for JHipster applications deployed in elastic clusters?leak-detection-threshold interact with these settings to prevent false positives during high-latency scaling events?33275 reputation · 03 Sept 2020, 18:48 UTC
Use comments to ask for clarification. Post a solution as an answer.
33,275 reputation · 03 Sept 2020, 21:46 UTC
In addition to sizing maximumPoolSize and minimumIdle, tune connectionTimeout to be comfortably below the pod’s termination grace period (e.g., 5 s vs 30 s) so that scaling‑in does not leave threads waiting for a checkout that will be killed. Pair this with a non‑zero validationTimeout (e.g., 3 s) and keepaliveTime (e.g., 30 s) to validate idle connections before they are reused, reducing the chance of borrowing a broken connection after a scale‑out event. These settings are orthogonal to pool size but directly affect latency and error rates during rapid autoscaling.