Performanceworker poolexecutorthread per request

Thread pool

Definition

A thread pool keeps a bounded number of pre-created threads and a queue of pending tasks; each free thread takes the next task, so the pool size is a concurrency limit.

In practice

Creating a thread per request is costly and unbounded; a pool reuses threads and caps memory and context switching. Servlet containers, ASP.NET, gRPC servers and database drivers all use pools. Size them from Little's law: throughput times hold time, plus headroom, and remember that blocked threads waiting on slow dependencies still count against the limit.

One shared pool lets a single slow dependency occupy every thread and starve unrelated requests; separate pools per dependency are the classic bulkhead. Oversized pools cause memory pressure and push more concurrent load onto the database, and an unbounded task queue hides overload behind ever-growing latency instead of rejecting work.

Example

A Tomcat server with maxThreads=200 and 40 ms requests serves about 5,000 requests per second; when a payment call slows to 2 s, 200 threads fill within a second and health checks start failing.