Red Hat ENTERPRISE LINUX 5 - VIRTUALIZATION GUIDE Manual page 347

Hide thumbs Also See for ENTERPRISE LINUX 5 - VIRTUALIZATION GUIDE:
Table of Contents

Advertisement

physical CPUs 0 to 3, or 4 to 7 to avoid accessing non-local memory, which are significantly slower
than accessing local memory.
If a guest requires eight virtual CPUs, as each NUMA node only has four physical CPUs, a better
utilization may be obtained by running a pair of four virtual CPU guests and splitting the work between
them, rather than using a single 8 CPU guest. Running across multiple NUMA nodes significantly
degrades performance for physical and virtualized tasks.
Decide which NUMA node can run the guest
Locking a guest to a particular NUMA node offers no benefit if that node does not have sufficient free
memory for that guest. libvirt stores information on the free memory available on each node. Use the
virsh freecell command to display the free memory on all NUMA nodes.
# virsh freecell
0: 2203620 kB
1: 3354784 kB
If a guest requires 3 GB of RAM allocated, then the guest should be run on NUMA node (cell) 1. Node
0 only has 2.2GB free which is probably not sufficient for certain guests.
Lock a guest to a NUMA node or physical CPU set
Once you have determined which node to run the guest on, refer to the capabilities data (the output of
the virsh capabilities command) about NUMA topology.
1.
Extract from the virsh capabilities output.
<topology>
<cells num='2'>
<cell id='0'>
<cpus num='4'>
<cpu id='0'/>
<cpu id='1'/>
<cpu id='2'/>
<cpu id='3'/>
</cpus>
</cell>
<cell id='1'>
<cpus num='4'>
<cpu id='4'/>
<cpu id='5'/>
<cpu id='6'/>
<cpu id='7'/>
</cpus>
</cell>
</cells>
</topology>
2.
Observe that the node 1, <cell id='1'>, has physical CPUs 4 to 7.
3.
The guest can be locked to a set of CPUs by appending the cpuset attribute to the configuration
file.
a.
While the guest is offline, open the configuration file with virsh edit.
b.
Locate where the guest's virtual CPU count is specified. Find the vcpus element.
Setting KVM processor affinities
333

Advertisement

Table of Contents
loading

Table of Contents