CPU limit
A cap on how much processor time a container may use, expressed as a number of processors.
In more detail
--cpus=0.5 means half of one processor. The kernel stores it in cpu.max as a quota and a period in microseconds, here 50000 out of every 100000. A container that hits its limit is slowed down (throttled) rather than killed.
Example
docker run --rm --cpus=0.5 alpine:3.20 cat /sys/fs/cgroup/cpu.max # 50000 100000Related terms
- control group — A Linux kernel feature that limits how much memory, processor time and other resources a group of processes may use.
- resource limit — A cap on how much memory, processor time or number of processes a container may use.
- CPU — The chip in a computer that runs program instructions; a machine can have several.
Taught in
- Kustomize Bases, Overlays And Patches — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Requests, Limits And Quotas — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Namespaces And Cgroups: Isolation And Limits — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Requests, Limits, Quotas And Horizontal Autoscaling — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: OOMKilled, Throttling And Evictions — Kubernetes: Production-Grade Container Orchestration