Container By Michael

Kubernetes 資源管理:Requests 與 Limits 的誤區

避免 OOMKilled

設定資源時常犯的錯誤是將 Requests 與 Limits 設得差異過大。

  • Requests:調度依據 (保證有的資源)。
  • Limits:硬上限 (超過會被 Throttled 或 Killed)。

最佳實踐:對於生產環境的核心服務 (Guaranteed QoS),建議將 requests 等於 limits,以確保獲得獨佔的 CPU 時間片與穩定的記憶體,避免鄰居吵雜 (Noisy Neighbor) 問題。