CPU weight

The host CPU time which is available for the execution of the virtual CPUs depends on the system utilization.

The available CPU time is divided up between the virtual servers running on the host.

The Linux® scheduler and the Linux kernel feature cgroups allocate the upper limit of CPU time shares (or simply: CPU shares) which a virtual server is allowed to use based on the CPU weight of all virtual servers running on the host.

You can configure the CPU weight of a virtual server, and you can modify it during operation.

The CPU shares of a virtual server are calculated by forming the virtual server's weight-fraction.

Example:
Virtual server CPU weight Weight-sum Weight-fraction CPU shares
A 1024 3072 1024/3072 1/3
B 2048 3072 2048/3072 2/3
The number of virtual CPUs does not affect the CPU shares of a virtual server.
Example:
Virtual server CPU weight Number of virtual CPUs
A 1024 2
B 1024 4
The CPU shares are the same for both virtual servers:
Virtual server CPU weight Weight-sum Weight-fraction CPU shares
A 1024 2048 1024/2048 1/2
B 1024 2048 1024/2048 1/2
The CPU shares of each virtual server are spread across its virtual CPUs, such as:
This graphic shows the CPU shares of two virtual servers on two host CPUs.