Healthcare Standards: Slight Improvement
- A recent optimization of a Spring Boot application using embedded Tomcat yielded a critically important performance boost.
- The problem arose from the interaction of HTTP and TCP keep-alive mechanisms.
- The application's security requirements mandated TLS negotiation for every request, negating the need for HTTP keep-alive.
Optimize your Spring Boot Tomcat submission for unparalleled performance. This article from News Directory 3 dives into a real-world scenario where a bottleneck—TCP connections—crippled a system despite sufficient resources. Discover how a simple configuration adjustment, setting server.tomcat.max-keep-alive-requests = 1, unlocked a 30x load capacity increase. Dig into the interplay of HTTP and TCP keep-alive mechanisms, understanding why excessive available connections, not high usage, became the critical issue. Learn how to slash CPU and memory costs by half. we’ll show you the exact steps to resolve the bottleneck and discuss future optimization plans. Discover what’s next.
Spring Boot Tomcat Tuning Dramatically Boosts Load Capacity
Updated June 4, 2025
A recent optimization of a Spring Boot application using embedded Tomcat yielded a critically important performance boost. The application,already capable of handling the system’s entire load with a single instance,experienced failures under increased stress despite ample resources. An inquiry revealed the bottleneck wasn’t memory, threading, or CPU, but rather the number of available TCP connections.
The problem arose from the interaction of HTTP and TCP keep-alive mechanisms. HTTP keep-alive, designed to reuse connections for multiple requests, and TCP keep-alive, which maintains idle connections, were combining to exhaust available connections.Long-running requests, essential for communicating with third-party services, exacerbated the issue.
The application’s security requirements mandated TLS negotiation for every request, negating the need for HTTP keep-alive. However,embedded Tomcat enables it by default. The solution involved adjusting a single setting.
Setting `server.tomcat.max-keep-alive-requests = 1` disabled HTTP keep-alive, resolving the connection exhaustion. This simple change resulted in a 30x increase in load capacity, with CPU and memory utilization remaining below 50%.The improvement allows for reduced CPU costs and a 50% decrease in memory requirements in production.
The key problem wasn’t a memory issue, threading issue, or a CPU load issue… As it turned out, the issue was not about the number of in-use TCP connections, but rather on the number of available TCP connections.
What’s next
The developer plans to address task startup time in a future optimization project.
