Re: How can we vzctl 101 set --cpuunits > 500 000 [message #49227 is a reply to message #49211] |
Thu, 11 April 2013 13:20   |
Paparaciz
Messages: 302 Registered: August 2009
|
Senior Member |
|
|
cpuunits is relative value.
if ct1 has 1000 cpuunits and ct2 had 3000 cpuunits it means only that ct3 gets 3times more cpu.
better use cpulimit and give number of cpu cores (--cpus) or give exactly cpu cores you want (--cpumask)
from man vzctl:
--cpuunits num
CPU weight for a container. Argument is positive non-zero number, passed to and used in the kernel fair scheduler. The larger the number is, the more CPU time this container gets. Maximum value is 500000, minimal is 8. Number is relative to weights of all the other running containers. If cpuunits are not specified, default value of 1000 is used.
You can set CPU weight for CT0 (host system itself) as well (use vzctl set 0 --cpuunits num). Usually, OpenVZ initscript (/etc/init.d/vz) takes care of setting this.
--cpus num
sets number of CPUs available in the container.
--cpumask cpus | all
sets list of allowed CPUs for the container. Input format is a comma-separated list of decimal numbers and ranges. Consecutively set bits are shown as two hyphen- separated decimal numbers, the smallest and largest bit numbers set in the range. For example, if you want the container to execute on CPUs 0, 1, 2, 7, you should pass 0-2,7. Default value is all (the container can execute on any CPU).
|
|
|