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 100000

Related terms

Taught in

References

Certification courses