resource limit
A cap on how much memory, processor time or number of processes a container may use.
A container with no memory limit can exhaust the host and get unrelated processes killed.
In more detail
Without limits a container can use everything the host has, so one misbehaving service can starve all the others. With limits, the same fault only hurts the container that caused it, which then restarts. Docker sets limits with run flags; Compose and Kubernetes set the same control group values from configuration. Set them from the start rather than after the first outage.
Related terms
- control group — A Linux kernel feature that limits how much memory, processor time and other resources a group of processes may use.
- memory limit — The most memory a container may use before the kernel kills a process inside it.
- CPU limit — A cap on how much processor time a container may use, expressed as a number of processors.
- PID limit — A cap on how many processes a container may run at the same time.
- OOM killer — The part of the Linux kernel that kills a process when memory runs out.
Taught in
- ConfigMaps And Secrets — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Namespaces And Cgroups: Isolation And Limits — Docker Architecture & Production Containers
- Docker, OCI, The Engine And The CLI — Docker Architecture & Production Containers
- Install Docker And Verify Your Environment — Docker Architecture & Production Containers
- Pull And Inspect A Third Party Image — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- From Local Containers To Kubernetes — Docker Architecture & Production Containers
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- Jobs And CronJobs — Kubernetes: Production-Grade Container Orchestration
- Requests, Limits, Quotas And Horizontal Autoscaling — Kubernetes: Production-Grade Container Orchestration
- Taints, Tolerations And Disruption Budgets — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: OOMKilled, Throttling And Evictions — Kubernetes: Production-Grade Container Orchestration
- Authentication, ServiceAccounts And Short Lived Tokens — Kubernetes: Production-Grade Container Orchestration
- Package The Service As A Helm Chart — Kubernetes: Production-Grade Container Orchestration