Previous page

Next page

Locate page in Contents

Print this page

Configuring the Number of CPUs

If your server has more than one physical processor installed, you can control the number of CPUs which will be used to handle the processes running in virtual machines and Containers. By default, a virtual machine and Container is allowed to consume the CPU time of all processors on the server, i.e. any process in any virtual machine and Container can be executed on any processor on the server. However, you can modify the number of physical CPUs which will be simultaneously available to a virtual machine or Container using the --cpus option of the pctl set command. For example, if your server has 4 physical processors installed, i.e. any virtual machine and Container on the server can make use of these 4 processors, you can set the processes in Container 101 and in the MyVM virtual machine to be run on 2 CPUs only by issuing the following commands:

# pctl set 101 --cpus 2 --save

Saved parameters for Container 101

# pctl set MyVM --cpus 2

set cpus(4): 2

The VM has been successfully configured.

Notes:

1. The number of CPUs for a virtual machine or Container must not exceed the number of physical CPUs installed on the server. In this case, the 'physical CPUs' notation designates the number of CPUs the Parallels Server Bare Metal kernel is aware of (you can view this CPU number using the /proc/cpuinfo command).

2. Before configuring the number of CPUs for a running virtual machine, make sure that the CPU hotplug support is enabled for this virtual machine. For detailed information on the CPU hotplug feature, see Enabling CPU Hotplug for Virtual Machines .

To make sure that the number of CPUs has been successfully changed, you can log in to Container 101 and the MyVM virtual machine and check the number of available CPUs. If the Container and virtual machine are running a Linux operating system, you can also use the cat /proc/cpuinfo command to view the available CPUs, for example:

# pctl exec 101 cat /proc/cpuinfo

processor : 0

vendor_id : GenuineIntel

cpu family : 15

model : 4

model name : Intel(R) Xeon(TM) CPU 2.80GHz

stepping : 1

cpu MHz : 2793.581

cache size : 1024 KB

...

processor : 1

vendor_id : GenuineIntel

cpu family : 15

model : 4

model name : Intel(R) Xeon(TM) CPU 2.80GHz

stepping : 1

cpu MHz : 2793.581

cache size : 1024 KB

...

The output shows that Container 101 is currently bound to only two processors on the server instead of 4 available for the other Containers on this server. It means that, from this point on, the processes of Container 101 will be simultaneously executed on no more than 2 physical CPUs while the other Containers on the server will continue consuming the CPU time of all 4 server processors, if needed. Also notice that the physical CPUs proper of Container 101 might not remain the same during the Container operation; they might change for load balancing reasons, the only thing that cannot be changed is their maximal number.