• No results found

Managing Container CPU Usage

Resources

The current section explains the CPU resource parameters that you can configure and monitor for each Container.

The table below provides the name and brief description for the available CPU parameters.

Parameter Description

CPU units This is a positive integer number that defines how much CPU time one Container will receive in comparison with the other Containers on the Hardware Node in case all the CPUs of the Node are fully used.

CPU limit This is a positive number indicating the CPU time, in percent, the corresponding Container is not allowed to exceed.

CPU guarantee This is a positive integer number that determines the minimal guaranteed share of the CPU time, in percent, the given Container is guaranteed to receive.

Number of CPUs The number of CPUs to be used to handle the processes running inside the corresponding Container.

Managing Container CPU Usage

In the current version of Virtuozzo Containers, you can configure and monitor the following CPU resource parameters for each Container on the Hardware Node:

ƒ CPU Units. CPU units represent a positive integer number that defines how much CPU time one Container will receive in comparison with the other Containers on the Hardware Node in case all the CPUs of the Node are fully used. For example, if Containers 101 and 103 are set to receive 1000 CPU units each and Container 102 - 2000 CPU units, Container 102 will get twice as much CPU time as Containers 101 or 103 in case all the CPUs of the Node are completely loaded.

Note: Processes belonging to any Container are scheduled for execution on all the CPUs of the Hardware Node. Consequently, Containers are not bound to only one CPU, and any application inside each Container can use all the free CPU power of the Node.

By default, the Hardware Node (Container 0) receives 5000 CPU units and each Container on the Node gets 1000 CPU units. In Virtuozzo Containers 4.0, you cannot modify what default CPU value is to be used for the Hardware Node and any of its Containers. However, you can change the current value of the CPU resource parameter for a particular Container (but not for the Node itself) by means of Parallels Management Console.

ƒ CPU guarantee. This is a positive integer number indicating the CPU time, in percent, the corresponding Container is guaranteed to receive. By default, this parameter is disabled for all Containers on the Hardware Node, i.e. the amount of CPU time allocated to a Container depends on the value of the CPU Units parameter and the Hardware Node workload. If both parameters - CPU Units and CPU guarantee - are set, the CPU guarantee parameter is first taken into account when distributing processor(s) time among the Containers existing on the Node; the remaining CPU time, if any, is given to the Containers in accordance with the value of the CPU Units parameter.

Any Container can consume more than the guaranteed value if there are no other Containers competing for the CPU (e.g. with higher values of the CPU Units parameter) and the value of the CPU guarantee parameter does not equal that of the CPU limit parameter.

ƒ CPU limit. This is a positive integer number indicating the CPU time, in percent, the corresponding Container is not allowed to exceed. By default, this parameter is disabled for all Containers on the Hardware Node, i.e. any application inside any Container can use all the free CPU power of the Node.

All three CPU resource parameters are controlled by the Virtuozzo hierarchical scheduler and can be configured by performing the following operations:

1 Click Virtuozzo Containers in the Parallels Management Console left pane, then right-click

the needed Container in the right pane, and choose Properties.

Figure 76: Management Console - Managing CPU Usage

3 In the Parameters table, double-click either the CPU Units, CPU limit, or CPU

guarantee parameter and enter the right value for the given Container in the Value field

of the Resource Counter Properties window:

ƒ For the CPU Units parameter, you can specify any value in the range from 50 to

50000 CPU units. In case the value defined for the CPU resource parameter is set out of

the allowed range, you will see the icon opposite the Allowed range field.

ƒ For the CPU limit parameter, you can enter any value in the range from 10 to 100. In

case the value defined for this CPU resource parameter is set out of the allowed range,

you will see the icon opposite the Allowed range field.

ƒ For the CPU guarantee parameter, you can enter any value in the range from 0 to

90. In case the value defined for this CPU resource parameter is set out of the allowed

range, you will see the icon opposite the Allowed range field.

Note: Specifying 0 as the value of the CPU guarantee parameter will remove all CPU guarantees for the given Container.

It is possible to change the CPU resource parameter for both stopped and running Containers. In the latter case, the changes will take effect immediately.

You can also use the vzctl set command with the --cpuunits, --cpulimit, and -- cpuguarantee options to set the CPU units, CPU limit, and CPU guarantee

parameters, respectively. Please consult the Parallels Virtuozzo Containers Reference Guide for

Related documents