Performance Articles
6 articles about Performance. Explore Spring Boot implementation, design, and operations across related topics.
-
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 Correctly Configure and Tune the HikariCP Connection Pool in Spring Boot - Why the Default of 10 Isn't Enough
A tuning walkthrough for eliminating "Connection is not available" errors with HikariCP in Spring Boot. Covers the default maximumPoolSize of 10 and the official sizing formula (cores × 2 + 1), reducing connectionTimeout from 30s to 3s, the relationship between maxLifetime and wait_timeout, and leak detection with leakDetectionThreshold, all with implementation examples. Includes comparison data showing the timeout error rate dropping from 40% to 3% after revisiting the configuration.
-
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.