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. 教学模型——数字用于说明行为,并非基准测试。

概念

建议先完成

相关挑战

参考资料