Interview Prep/Docker/Resource Limits, Health & Reliability

What is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?

BeginnerProductionResource Limits, Health & Reliability
Answer

--cpus=2 is a hard quota (CFS bandwidth: 200ms per 100ms period). --cpu-shares is a relative weight (default 1024) used only under contention, with no cap. --cpuset-cpus=0,1 pins to specific cores, useful for NUMA/latency-sensitive workloads. Shares are the "soft" option, cpus the "hard" one.

All Docker questions Roadmap: Docker & containers

More on Resource Limits, Health & Reliability