ConnectionTimeoutException during concurrent request spikes in HikariCP
0 reputation · 17 Aug 2024, 15:01 UTC
Connection Pool Exhaustion in JHipster Applications
JHipster-generated Spring Boot applications rely on HikariCP for database connection pooling. Under high concurrency, the application may encounter a ConnectionTimeoutException when the number of active request threads exceeds the configured maximum-pool-size, causing threads to block until the connection-timeout threshold is reached.
While manual tuning of properties is possible, the default sizing in JHipster blueprints remains static and does not automatically scale based on the underlying container resource limits or hardware specifications.
What is the recommended strategy for balancing the maximum-pool-size to prevent timeout exceptions without introducing excessive context switching or database server resource contention? How can the pool be configured to scale dynamically relative to available system resources?