Rate This Document
Findability
Accuracy
Completeness
Readability

Cluster Optimization Configuration for Four-NUMA Node Scenarios

Optimize CPU cluster configurations by binding VM vCPUs to specific physical CPU cores and configuring the vCPU topology to ensure the optimal performance for VMs.

To enhance VM performance, it is standard practice to assign VM vCPUs to particular physical CPU cores and define the VM vCPU topology. You are advised to perform 1:1 binding between VM vCPUs and physical CPU cores, and minimize the number of clusters that contain the bound physical CPU cores, to achieve peak performance.

This document uses a VM with 32 vCPUs and 64 GB memory as an example to describe how to optimize the cluster configuration. Adjust the parameters based on requirements and VM specifications.

  1. Find the name of the target VM.
    1
    virsh list --all
    

  2. Modify the VM XML file.
    1
    virsh edit <VM_name>
    
    The following is a configuration example illustrating a cluster optimization policy. In this example, the cputune section establishes a 1:1 binding between vCPUs and physical CPU cores. In the numatune section, only one NUMA node is set for the VM, and nodeset points to the NUMA node where the physical CPU core is located. In the cpu section, configure one socket, one die, four clusters, with each cluster containing four vCPUs and a thread count of two per core.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    <domain type = 'KVM'>
    ...
      <vcpu placement='static'>32</vcpu>
      <cputune>
        <vcpupin vcpu='0' cpuset='8'/>
        <vcpupin vcpu='1' cpuset='9'/>
        <vcpupin vcpu='2' cpuset='10'/>
        <vcpupin vcpu='3' cpuset='11'/>
        <vcpupin vcpu='4' cpuset='12'/>
        <vcpupin vcpu='5' cpuset='13'/>
        <vcpupin vcpu='6' cpuset='14'/>
        <vcpupin vcpu='7' cpuset='15'/>
        <vcpupin vcpu='8' cpuset='16'/>
        <vcpupin vcpu='9' cpuset='17'/>
        <vcpupin vcpu='10' cpuset='18'/>
        <vcpupin vcpu='11' cpuset='19'/>
        <vcpupin vcpu='12' cpuset='20'/>
        <vcpupin vcpu='13' cpuset='21'/>
        <vcpupin vcpu='14' cpuset='22'/>
        <vcpupin vcpu='15' cpuset='23'/>
        <vcpupin vcpu='16' cpuset='24'/>
        <vcpupin vcpu='17' cpuset='25'/>
        <vcpupin vcpu='18' cpuset='26'/>
        <vcpupin vcpu='19' cpuset='27'/>
        <vcpupin vcpu='20' cpuset='28'/>
        <vcpupin vcpu='21' cpuset='29'/>
        <vcpupin vcpu='22' cpuset='30'/>
        <vcpupin vcpu='23' cpuset='31'/>
        <vcpupin vcpu='24' cpuset='32'/>
        <vcpupin vcpu='25' cpuset='33'/>
        <vcpupin vcpu='26' cpuset='34'/>
        <vcpupin vcpu='27' cpuset='35'/>
        <vcpupin vcpu='28' cpuset='36'/>
        <vcpupin vcpu='29' cpuset='37'/>
        <vcpupin vcpu='30' cpuset='38'/>
        <vcpupin vcpu='31' cpuset='39'/>
        <emulatorpin cpuset='8-39'/>
      </cputune>
    ...
      <numatune>
        <memnode cellid='0' mode='strict' nodeset='0'/>
      </numatune>
    ...
      <cpu mode='host-passthrough' check='none'>
        <topology sockets='1' dies='1' clusters='4' cores='4' threads='2'/>
     ...
      </cpu>
    ...
    <domain>