Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Internal_display_only
serverRibbon JIRA
serverIdd45d42c2-4546-3f1b-bbde-ff79196e8c48
keyDSC-22108


Panel

In this section:

Table of Contents
maxLevel3

...

Note

If available for operating systems where the utility tuned-admin exists (most recent releases of Red Hat derived O/Ses), the virtual-host setting is very beneficial for guest VM responsivity.

  • To verify current settings:

tuned-adm active (output should be virtual-host)

  • To set this in the running kernel:

tuned-adm profile virtual-host

  • To set this permanently on Red Hat systems:

echo virtual-host > /etc/tuned/active_profile

...


The Linux Virtual Machine Manager (virt-manager) Tool

...

The following figure shows virt-manager running on a local Linux desktop OS and remotely managing three VMs installed on two physical KVM Hosts.

...

...

Virt-manager Connected To KVM Hosts And Managing Three VMs

Image Modified

Allocating CPU Resources

The Installer tool assigns the first four CPU cores to a VM when it is created. A second VM created on the same KVM Host requires the same resource allocation as the first VM.

...

Info
titleNote

If SS7 and Diameter are running on the same VM, then eight CPU cores must be assigned to the VM. In addition to the four CPU cores assigned as default when the VM was created, four CPU cores are added to the default setting.


Note
titleCaution

Proper performance of the DSC requires full cores and not hyperthreaded cores.  When pinning, use only Processor IDs that represent actual cores, not hyperthreaded cores.

If you do not statically pin vCPUs to physical CPUs, your system may incur a significant degradation in performance.

...


Anchor
Assigning a VM (vCPU) to a Physical CPU Device
Assigning a VM (vCPU) to a Physical CPU Device
Assigning a VM (vCPU) to a Physical CPU Device

...

Open the VM using virt-manager to view and set the VM's CPU parameters.

The CPU Pinning option is set in virt-manager's Processor Configuration screen, as shown in the following figure.

...

...

Virt-manager's Processor Configuration Screen - CPU Pinning Option

Image Modified

You can also use the following commands to assign a VM (vCPU) to a pysical CPU device.

Code Block
# virsh vcpupin <VM_name> x y --live --config


Note
titleCaution

Using the KVM GUI software to set the CPU pinning is prone to errors. Certain versions of the virt-manager software do not provide full support for the CPU pinning function. It is recommended that you verify CPU pinning on your system using the Linux system command (virsh) in a console window, for example:

  # virsh vcpupin <VM_name>

  VCPU: CPU Affinity
  ----------------------------------
  0: 12
  1: 13
  2: 14
  3: 15
  4: 16
  5: 17

In the above example, the output indicates six vCPUs of <VM_name> are each assigned to one physical CPU device. The CPU mapping begins with vCPU_0 pinned to physical CPU_12; and continues to vCPU_5 pinned to physical CPU_17.


Assigning Additional VM Processes

...

Code Block
# virsh emulatorpin <VM_name> --cpulist 0-3 --config --current

...


Using NUMA Domains (optional)

Div

In a multi-processor system, NUMA allows some CPUs to access system resources faster than other CPUs. In a Linux OS, system resources are split up into NUMA domains.

NUMA domains are used in virt-manager to set the CPU Pinning option of the VM.

To identify NUMA domains on the KVM Host, run the command, lscpu (Linux RedHat OS), at the system prompt. For example, on a KVM Host running a Linux RedHat OS, the command returns the following:

Code Block
languagenone
Example:
lscpu NUMA node0 CPU(s):&nbsp;&nbsp;&nbsp;&nbsp; 0-5,12-17 NUMA node1 CPU(s):&nbsp;&nbsp;&nbsp;&nbsp; 6-11,18-23


Info
titleNote

In the above example, Processor ID's [12-17] represent the Hyperthreading component of CPUs [0-5]. For more details, see the section on Hyperthreading.   

...



Using the Host CPU Configuration

Div

A VM uses special features available on a physical CPU device if it is allowed to identify all CPU resources (and their features) on the KVM Host. Host CPU visibility can be enabled in virt-manager using the 'Copy Host CPU Configuration' button available in the Processor Configuration screen. The following figure shows virt-manager's Processor Configuration screen and the location of the 'Copy host CPU configuration' button.

The VM CPU and emulator pinning can be configured at install time using the installation file (refer to The VM Configuration File).

Caption
0Figure
1Virt-manager's Processor Configuration Screen - Copy Host CPU Configuration Button


...

Div

Recent CPU devices allow CPU Frequency Scaling to reduce power consumption when only partial CPU resources are required. Under heavy traffic (or traffic bursts) conditions, the DSC SWe VM performs better (that is, maintains a higher throughput with less latency) if CPU Frequency Scaling is disabled and the CPU cores are permitted to run at full speed all the time.

To disable CPU Frequency Scaling, run the following Bash command on the KVM Host for each CPU running a VM :

Code Block
languagenone
Example for cpu0 and cpu1:
bash# echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
bash# echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

On systems running a RedHat LinuxOS, the above command is used to set the CPU Frequency Scaling option, which can be enabled at runtime for specific Processor IDs.

Info
titleNote

Alternatively, the Performance Scaling Governor setting forces the CPU cores to operate at full speed at all times, which increases power consumption by a larger magnitude in comparison to the more conservative Frequency Scaling Governor.

The Frequency Scaling Governor setting does not persist across KVM Host reboots. If the KVM Host is running a RedHat OS variant, this setting can be made persistent by adding the line(s) to /etc/rc.d/rc.local. For further details, please consult the support documentation for your Linux OS on the KVM Host.

Pagebreak

General Recommendations

Div

Some general recommendations are presented in this section, however, the list is not exhaustive. For more information on VM performance tuning, please consult your Linux OS and KVM Host vendor documentation.

Tip
titleTip

When modifying VM tuning parameters, the measured effect on performance varies, depending on the Linux OS running on the KVM Host and network infrastructure. The following VM tuning parameters are suggested:

  • If a VM has N virtual cores, ensure the VM has access to at least N physical cores. Use CPU Pinning (use virt-manager's Processor Configuration screen) to explicitly map each virtual core to a physical core.

  • If two VMs are installed on the same KVM Host, the recommendation is to assign different physical CPU cores and NUMA domains, where possible.

  • Allow the VM to know the CPU type on the KVM Host. Use the virt-manager “Copy Host CPU Configuration” option in the Processor Configuration screen.

  • Set the KVM Host Frequency Scaling Governor to run the CPU cores assigned to the VM at full speed (disable Frequency Scaling). Disabling CPU frequency scaling increases power consumption but ensures the greatest number of CPU cycles are available to handle traffic bursts and high traffic congestion.

 

...