Article ID: 6449, created on Jun 18, 2009, last review on Apr 27, 2014

  • Applies to:
  • Virtuozzo containers for Windows 4.5


If your physical server has more than one processor installed, you can control the number of CPUs that will be used to handle the processes running inside particular Containers. The procedure of allocating only a defined set of processors to your Containers is performed by creating special CPU pools and assigning these pools to specific Containers. Assigning a CPU pool to a Container means that all processes running inside this Container will be handled only by the CPUs included in the assigned CPU pool.

1. Creating new CPU pools:

   vzcpucfg pool set POOL_ID CPU_RANGE

   where, POOL_ID is name of creating CPU pool
              CPU_RANGE is the CPU range to be included in the CPU pool.

   Note: A range may contain one or several CPUs (for example, 1 or 1-3). You can also specify several ranges at once and separate them by commas (for example, 0-2,3-6,8). It is possible to include one and the same processor in more than one CPU pool.

   An example of creating two CPU pools:

   vzcpucfg pool set Pool_1 0-1
   vzcpucfg pool set Pool_2 0-1,3,4-5

2. Listing the CPU pools currently existing on the node:

   vzcpucfg pool list

3. Deleting the  CPU pools:

   vzcpucfg pool del

4. Assigning CPU pools to containers:

   vzctl set CT_ID --cpupool POOL_ID --save

   Note: Restart of the container is required for the changes to take effect.

5. Configuring number of CPUs for container within CPU pool:

   vzctl set CT_ID --cpus number --save

   where, number is a number of CPUs that will be simultaneously available to the container within the assigned pool.

   Note: Restart of the container is required for the changes to take effect.

6. Listing containers with assigned CPU pools:

   vzlist -o ctid,cpupool

d09cb2230ee0cfa720ed0f2a3cc39452 d02f9caf3e11b191a38179103495106f 965b49118115a610e93635d21c5694a8 2897d76d56d2010f4e3a28f864d69223

Email subscription for changes to this article
Save as PDF