Tuning Articles
4 articles about Tuning. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Configure and Tune Caffeine Cache in Spring Boot - From expireAfterWrite and maximumSize to Production Operations with stats()
A practical guide to tuning Caffeine cache per-cache in Spring Boot. Covers the distinction between expireAfterWrite and expireAfterAccess, size management with maximumSize and Weigher, asynchronous refresh with refreshAfterWrite, and hit ratio monitoring with recordStats() and Micrometer — everything you need to know before going to production.
-
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.
-
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 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%.