Performance Articles
7 articles about Performance. 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 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 Speed Up Bulk INSERTs with Spring Data JPA - hibernate.jdbc.batch_size and Batching saveAll
Explains why calling saveAll() still results in INSERTs being executed one at a time, covering the mechanics of hibernate.jdbc.batch_size, order_inserts, and IDENTITY generation. From PostgreSQL's reWriteBatchedInserts to a comparison with JdbcTemplate.batchUpdate, it walks through the steps to speed up bulk INSERTs while verifying with SQL logs.
-
How to Speed Up Spring Boot Application Startup - Reducing Time with CDS, AOT, and Lazy Initialization
Spring Boot apps starting too slowly, causing Pods to miss readiness probes, or breaking your focus during local rebuilds—this guide solves those problems with practical steps. Learn how to identify bottlenecks with Actuator startup, then progressively apply lazy initialization, AutoConfig exclusion, CDS, and AOT to consistently reduce startup time.
-
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%.
-
Spring Boot Virtual Threads (Java 21): Setup, Performance, and Pitfalls
Enable virtual threads in Spring Boot 3.2+ with one setting. Covers performance benchmarks vs platform threads, ThreadLocal behavior changes, pinning issues, and @Async integration.
-
How to Implement Asynchronous Processing in Spring Boot - Using @Async and @EnableAsync
An implementation guide for @Async / @EnableAsync, compatible with Virtual Threads in Spring Boot 3.2+ / Java 21. Learn how to speed up your API by running email sending and external API calls in the background, with production know-how covering ThreadPoolTaskExecutor sizing, RejectedExecutionHandler, graceful shutdown, MDC propagation (TaskDecorator), and CompletableFuture, all explained with implementation examples.