Connection Pool Articles
5 articles about Connection Pool. Explore Spring Boot implementation, design, and operations across related topics.
-
HikariCP Pool Sizing for Multiple DataSources in Spring Boot
This article explains how to design HikariCP pool sizes when working with multiple DataSources in a primary/replica or multi-DB setup, covering how to work backward from the DB-side max_connections budget and allocate it across each maximumPoolSize, with concrete calculation steps and application.yml configuration examples.
-
How to Detect and Debug HikariCP Connection Leaks in Spring Boot - leakDetectionThreshold and Thread Dump Analysis
This article walks through diagnosing the symptom of HikariCP's active connection count steadily increasing and exhausting over time, covering leakDetectionThreshold configuration, how to read the warning logs, pinpointing the leak location by cross-referencing thread dumps, and fixing it with try-with-resources.
-
Why HikariCP Fails to Connect When Scaling Spring Boot to Multiple Replicas on Kubernetes - Reverse-Engineering maximumPoolSize from the DB's max_connections
This article explains why 'too many connections' errors occur when scaling out a Spring Boot application on Kubernetes, and describes a design approach for reverse-engineering the per-Pod HikariCP maximumPoolSize from the DB's max_connections and the number of replicas.
-
Causes and Fixes for HikariCP "Failed to validate connection" and "Connection is closed" in Spring Boot - How to Decide maxLifetime and keepaliveTime
Learn how to isolate HikariCP "Failed to validate connection" and "Connection is closed" errors by pool stage, how to derive maxLifetime and keepaliveTime from DB and network timeouts, and how to diagnose why the pool does not recover after a DB restart.
-
How to Properly Configure and Tune HikariCP Connection Pool in Spring Boot - Why the Default of 10 Isn't Enough
A tuning guide to eliminate Connection is not available errors in Spring Boot's HikariCP. Covers the maximumPoolSize default of 10 versus the official formula (cores × 2 + 1), revisiting connectionTimeout from 30 seconds to 3 seconds, the relationship between maxLifetime and wait_timeout, and leak detection with leakDetectionThreshold, all with implementation examples. Includes comparative data showing how configuration review reduced the timeout error rate from 40% to 3%.