Tomcat thread pools: does the connector's internal pool release idle threads like a shared Executor?
0 reputation · 10 Apr 2026, 18:53 UTC
0 reputation · 10 Apr 2026, 18:53 UTC
Goal: shrink the memory footprint of a low-traffic Tomcat deployment enough to fit a cheaper hosting tier, by tuning the HTTP Connector's documented thread-pool limits rather than the heap alone.
Two documented mechanisms are in play. The connector exposes maxThreads (long-standing default 200) and minSpareThreads (default 10), and worker threads reserve JVM stack whether or not requests arrive. Separately, a shared <Executor> (StandardThreadExecutor) documents maxIdleTime, default 60000 ms, terminating idle threads above minSpareThreads. The catch: whether the connector-internal pool reaps idle threads after a burst looks implementation- and version-sensitive, while the shared Executor documents that reaping explicitly, so the two are not interchangeable in behavior.
Constraints: peak concurrency must still fit inside maxThreads, and a very low minSpareThreads can add thread-creation latency after a quiet period. Assumption: Tomcat 9 or 10.x with the NIO HTTP/1.1 connector; the config docs shipped with the installed distribution are authoritative for defaults.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.