⚙️application / jvm

Tomcat Thread Pool Starvation

middle30 min🏢 Travel booking platform (peak holiday season)
JavaTomcatThread PoolBlocking I/OSpring MVCLoad Testing

Tech Stack

  • Java 17
  • Spring MVC 6
  • Tomcat 10
  • PostgreSQL 15
  • Redis 7
🚨

Incident Scenario

The booking API handles steady-state load (150 RPS) perfectly — P95 under 120ms.
During a flash sale, traffic spikes to 450 RPS. Within 90 seconds, response times jump to 30s and HTTP 503s begin.
CPU stays at 35%. Heap is fine. GC is normal. The app is not "crashing" — it just stops responding.
What is happening?

🔍 Investigation Artifacts

Reveal artifacts one by one. Each clue brings you closer to the root cause.

📊
Clue #1 · graph
Latency + Thread Pool Metrics
💡 Notice the relationship between active threads and latency — what happens when threads hit the maximum?
📋
Clue #2 · log
Thread Dump Analysis
💡 What are the threads waiting for? Are they waiting for CPU or for something else?
⚙️
Clue #3 · config
Tomcat + HikariCP Configuration
💡 What is the relationship between thread pool size and connection pool size?
⚙️
Clue #4 · config
BookingService — Request Flow
💡 Can the 3 database calls be parallelized or batched?