Chapter 11 - Performance
本章目標
看完本章後,你應該可以回答:
- latency、throughput、scaling bottleneck 怎麼判斷?
- CloudFront、ElastiCache、read replica、DAX 各自改善什麼?
- EC2 instance family、Auto Scaling、Lambda concurrency 怎麼影響效能?
- 全球使用者與高流量題目怎麼拆?
一句話
Performance 是讓系統在需求流量下維持可接受的 latency、throughput 和 user experience。
架構位置
Performance 可能發生在 edge、network、compute、database、cache、queue、storage 任一層。
常見服務與概念
- CloudFront
- Global Accelerator
- ElastiCache
- RDS read replica
- DynamoDB DAX
- Auto Scaling
- EC2 instance family
- Lambda concurrency
- S3 Transfer Acceleration
PM 視角
PM 要把「很慢」拆成可討論的需求:哪個地區慢?讀慢還是寫慢?尖峰時慢還是一直慢?需要即時回應還是可非同步?
Developer / DevOps 視角
工程師要先定位 bottleneck,再選服務:global latency 看 edge,database read bottleneck 看 replica/cache,burst traffic 看 scaling/queue。
考試怎麼問
常見題型會問:
- 全球靜態內容加速
- database read latency 太高
- API burst traffic 太高
- high throughput compute workload
- S3 大檔跨區上傳效能
常見陷阱
| 陷阱 | 正確方向 |
|---|---|
| 所有效能問題都加 EC2 | 先找 bottleneck layer |
| CloudFront 只用於網站圖片 | API / dynamic content 也可能受益,但要看題目 |
| cache 解決所有 DB 問題 | cache 適合 read-heavy / repeated reads,不適合所有一致性需求 |
| read replica 解決 write bottleneck | read replica 主要改善讀取 |