Skip to main content

How does Docker implement deterministic CPU throttling across containers?

Expert Docker
Quick Answer Docker uses the cpu.cfs_period_us and cpu.cfs_quota_us cgroup parameters to implement CPU throttling using the Completely Fair Scheduler (CFS). A container with --cpus=0.5 gets 50ms of CPU time per 100ms period. This is deterministic and enforced by the kernel regardless of host CPU load.

Answer

cgroups v2 applies weighted fair sharing using quotas and CPU weights.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice