The Real Fullstack

The Autoscaling Paradox

Kubernetes scaled from 8 to 40 pods during the peak. Why did response times double?

アーキテクト10 分パフォーマンスラボフローシミュレーター
kuberneteshpapostgresqlpgbouncer

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

ミッション:Serve 3,000 requests per second with ≤ 1% errors, database utilisation ≤ 80%, and at most 16 pods' worth of cost.背景 · 学習目標 ▾

Larkspur's API runs behind a HorizontalPodAutoscaler. During a promotion, latency rose, the HPA kept adding pods up to the maximum, and the database — now juggling 400 connections — slowed down for everyone.

ミッション: Serve 3,000 requests per second with ≤ 1% errors, database utilisation ≤ 80%, and at most 16 pods' worth of cost.

学習目標

  • See how scaling a tier moves load to a shared dependency.
  • Understand connection contention in PostgreSQL.
  • Use a connection pooler and scale on the real bottleneck.
シミュレーション
シミュレーション値
Load balancerAPI podsPostgreSQL
シミュレーションを実行

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

簡略化

Each active database connection adds a small amount of contention overhead to every query; real behaviour depends on locks, memory and workload. 教育用モデルです。数値は挙動を示すためのもので、ベンチマークではありません。

コンセプト

先に取り組むと役立つ課題

関連する課題

参考資料