3.1.4. Binding CPUs to NUMA Nodes

On systems with a NUMA (Non-Uniform Memory Access) architecture, you can configure containers to use CPUs from specific NUMA nodes only. Let us assume the following:

  • Your physical server has 8 CPUs installed.
  • The CPUs are divided into 2 NUMA nodes: NUMA node 0 and NUMA node 1. Each NUMA node has 4 CPUs.
  • You want the processes in the container MyCT to be executed on the processors from NUMA node 1.

To set the container MyCT to use the processors from NUMA node 1, run the following command:

# prlctl set MyCT --nodemask 1

To check that the container MyCT is now bound to NUMA node 1, use this command:

# prlctl list -i MyCT | grep nodemask
  cpu cpus=unlimited VT-x hotplug accl=high mode=32 cpuunits=1000 ioprio=4 nodemask=1

To unbind the container MyCT from NUMA node 1, execute this command:

# prlctl set MyCT --nodemask all

Now the container MyCT should be able to use all CPUs on the server again.

Note

Note: For more information on NUMA, visit http://lse.sourceforge.net/numa.