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?

シニアエンジニア10 分パフォーマンスラボフローシミュレーター
javaspring-boothttpresilience4j

この課題はまだ日本語に翻訳されていません。英語版を表示しています。

ミッション: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.背景 · 学習目標 ▾

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.

ミッション: 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.

学習目標

  • 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.
シミュレーション
シミュレーション値
ShoppersWeb tierPricing API
シミュレーションを実行

シミュレーションを実行すると出力が表示されます。

簡略化

Steady-state queueing (M/M/c) with a single dependency. Real incidents have bursts, garbage collection and timeouts at several layers. 教育用モデルです。数値は挙動を示すためのもので、ベンチマークではありません。

コンセプト

関連する課題

参考資料