User`s guide

Managing Resources 90
Managing CPU Share
The Parallels Server Bare Metal CPU resource control utilities allow you to guarantee any
Container the amount of CPU time this Container receives. The Container can consume more
than the guaranteed value if there are no other Containers competing for the CPU and the
cpulimit parameter is not defined.
Note: The CPU time shares and limits are calculated on the basis of a one-second period. Thus,
for example, if a Container is not allowed to receive more than 50% of the CPU time, it will be
able to receive no more than half a second each second.
To get a view of the optimal share to be assigned to a Container, check the current server CPU
utilization:
# vzcpucheck
Current CPU utilization: 11142
Power of the node: 125504
The output of this command displays the total number of the so-called CPU units consumed by
all running Containers and server processes. This number is calculated by Parallels Server Bare
Metal with the help of a special algorithm. The above example illustrates the situation when the
server is underused. In other words, the running Containers receive more CPU time than was
guaranteed to them.
In the following example, Container 102 is guaranteed to receive about 4% of the CPU time
even if the server is fully used, or in other words, if the current CPU utilization equals the power
of the server. Besides, Container 102 will not receive more than 25% of the CPU time even if
the CPU is not fully loaded:
# pctl set 102 --cpuunits 5000 --cpulimit 25 --save
Saved parameters for Container 102
# pctl start 102
Starting Container ...
Container is mounted
Adding IP address(es): 192.168.1.102
Container start in progress...
# vzcpucheck
Current CPU utilization: 15154
Power of the Node: 125504
Container 102 will receive from 4% to 25% of the server CPU time unless the server is
overcommitted, i.e. the running virtual machines and Containers have been promised more CPU
units than the power of the server. In this case the Container might get less than 4 percent.
Note: To set the --cpuunits parameter for the server, you should indicate 0 as the Container
ID (e.g. pctl set 0 --cpuunits 5000 --save).