Back to updates

Document resource limits and requests best practices

Approved & merged
by Sarah KimAug 31, 2026

This is where cuneify opens the PR

Connect your wiki to do it for real.

Sign up
New page166 words · 5 sections

Resource Requests and Limits

Every production pod should define CPU and memory requests and limits. Requests determine scheduling; limits prevent runaway containers from affecting neighbors.

Setting Requests

Base requests on the P50 usage observed in production over a 7-day window:

resources:
  requests:
    cpu: 250m
    memory: 256Mi

Setting Limits

Set limits at 2-3x the request to allow burst capacity without risking node stability:

resources:
  limits:
    cpu: 750m
    memory: 512Mi

What Happens When Limits Are Exceeded

  • CPU: The container is throttled. It won't be killed but will run slower.
  • Memory: The container is OOM-killed and restarted. Check for this with kubectl describe pod — look for "OOMKilled" in the last state.

Right-Sizing Workflow

  1. Deploy with generous limits and no CPU limit initially
  2. Monitor actual usage with kubectl top pod or Prometheus metrics for 1-2 weeks
  3. Set requests to P50 usage, limits to P99 usage + 20% buffer
  4. Review quarterly as traffic patterns change