Hikaricp Articles
8 articles about Hikaricp. 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.
-
How to Monitor HikariCP Connection Pool with Micrometer and Actuator in Spring Boot
Explains how to visualize the Micrometer metrics (active/idle/pending) exposed by HikariCP using Actuator and Prometheus, and how to design alerts that detect signs of connection exhaustion before a failure occurs.
-
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 Tune Embedded Tomcat Thread Count in Spring Boot - Deciding server.tomcat.threads.max, max-connections, and accept-count
This article explains at which stage of request handling server.tomcat.threads.max, threads.min-spare, max-connections, and accept-count take effect in Spring Boot 3.x's embedded Tomcat, and walks through a procedure for choosing values with evidence using Actuator's tomcat.threads.* metrics and load testing. It also covers alignment with HikariCP's maximumPoolSize and the differences when Virtual Threads are enabled.
-
How to Connect Spring Boot to MySQL - application.yml Configuration, JDBC URL Parameters, and Time Zone/Character Encoding Pitfalls
A step-by-step guide to connecting Spring Boot 3.x to MySQL 8, covering Docker Compose startup, application.yml configuration, and connectivity checks. Also covers recommended JDBC URL parameter values and how to fix the Public Key Retrieval error, date/time offsets, and utf8mb4 garbled characters.
-
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%.