The Real Fullstack

The Thread Pool Collapse

Only the product page calls the pricing API. So why did checkout and the health check go down too?

Ingeniero sénior10 minLaboratorio de rendimientoSimulador de flujos
javaspring-boothttpresilience4j

Este reto aún no está traducido al Español. Estás leyendo la versión en inglés.

Misión:Inject the incident to see the collapse, then keep the whole service fast and error-free while pricing stays slow — without simply throwing more threads at it.Contexto · Objetivos de aprendizaje ▾

Fernway's Spring Boot web tier serves 300 requests per second with a pool of 50 request threads. 30% of requests (product pages) call an external pricing API, normally in 80 ms. Tonight the pricing provider degrades to 2 seconds per call.

Misión: Inject the incident to see the collapse, then keep the whole service fast and error-free while pricing stays slow — without simply throwing more threads at it.

Objetivos de aprendizaje

  • Explain how blocking calls to a slow dependency exhaust a shared thread pool.
  • Use timeouts, circuit breakers and fallbacks to contain a failing dependency.
  • Tell apart a capacity fix from a resilience fix.
Simulación
Simulado
ShoppersWeb tierPricing API
Ejecutar simulación

Ejecuta la simulación para ver la salida.

Simplificación

Steady-state queueing (M/M/c) with a single dependency. Real incidents have bursts, garbage collection and timeouts at several layers. Modelo educativo: los números ilustran un comportamiento, no son benchmarks.

Conceptos

Retos relacionados

Referencias