3.1.3.2. Using --cpus to Set CPU Limits

Another way of setting a CPU limit for a virtual machine or container is to use the prlctl set --cpus command. In this case, you can specify how many logical CPU cores the virtual machine or container may use. For example, to allow the container MyCT to use only 2 cores, run this command:

# prlctl set MyCT --cpus 2

To make sure that the CPU limit has been successfully set, you check /proc/cpuinfo in the container. For example:

# prlctl exec MyCT cat /proc/cpuinfo | grep "cpu cores"
cpu cores       : 2