Cloud Intermediate
Kubernetes Resource Limits and Requests¶
KubernetesResourcesPerformance 3 min read
Proper CPU and memory configuration for pods. Requests, limits, QoS and OOMKill.
Requests vs Limits¶
spec:
containers:
- name: app
resources:
requests: # Guaranteed minimum
cpu: 250m # 0.25 CPU
memory: 256Mi
limits: # Maximum
cpu: 1000m # 1 CPU
memory: 512Mi
Requests = the scheduler uses them for placement. Limits = kernel enforced maximum.
QoS Classes¶
- Guaranteed — requests == limits (highest priority)
- Burstable — requests < limits
- BestEffort — no requests/limits (first to be OOMKilled)
Summary¶
Always set requests (correct scheduling). Memory limits protect the node. CPU limits are controversial — many recommend only using requests.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.