CPU usage limit container docker

Docker container to limit CPU usage:

$ docker run -it --cpus="8" xxx /bin/bash

--cpus parameters can be simply understood as the number of CPU Core (accurate to one decimal place, such as 1.5), - cpus = "8" may be used up to 100% of the CPU 8 Core, but in fact, this system will be 8 100% (i.e. 800%) of the total number average molecular core, such as the total number of core 20, the actual use of 8 / 20x100% = 40%, i.e., each core using up to 40%.

Guess you like

Origin blog.51cto.com/yangzhiming/2426619