Cisco Catalyst 8000V Edge Software Installation And Configuration Guide

PDF

Performance Enhancements in KVM Environment

Want to summarize with AI?

Log in

Overview

Provides all the settings and configurations you need to enhance the performance for Cisco Catalyst 8000V running in KVM environments.

Increase the performance of a Cisco Catalyst 8000V instance running in a KVM environment by modifying certain settings on the KVM host. These settings are independent of the IOS XE configuration settings on the Cisco Catalyst 8000V instance.

  • These settings might affect the number of VMs you can instantiate on a server.

  • Tuning steps are most impactful for a small number of VMs that you instantiate on a host.

To improve the KVM configuration performance, Cisco recommends that you do the actions listed in this table.

Action

Sample configuration (if applicable)

Enable vCPU pinning

 <cputune>
    <vcpupin vcpu='0' cpuset='3'/>
    <emulatorpin cpuset='3'/>
  </cputune>

Enable emulator pinning

 <cputune>
    <vcpupin vcpu='0' cpuset='3'/>
    <emulatorpin cpuset='3'/>
  </cputune>

Enable numa tuning.

Ensure that all vCPUs are pinned to the physical cores on the same socket.

  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>

Set hugepage memory backing

 <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <hugepages>
      <page size='1048576' unit='KiB' nodeset='0'/>
    </hugepages>
    <nosharepages/>
  </memoryBacking>

Use virtio instead of IDE

<devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/rhel7.0.qcow2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

Use graphics VNC instead of SPICE.

<graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1' keymap='en-us'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>

Remove unused devices such as USB, tablet devices

Disable memballoon

<memballon model='none'>

CPU pinning

Improve the performance of KVM environments by using the KVM CPU Affinity option to assign a virtual machine to a specific processor. To use this option, configure CPU pinning on the KVM host.

In the KVM host environment, use these commands:

Command

Action

virsh nodeinfo

Verifies the host topology to find out how many vCPUs are available for pinning by using the following command.

virsh capabilities

Verifies the available vCPU numbers.

virsh vcpupin<vmname> <vcpu#> <host core#>

Pins the virtual CPUs to sets of processor cores.

Execute this KVM command for each vCPU on your Cisco Catalyst 8000V instance.

  • This example pins the virtual CPU 1 to host core 3.

    virsh vcpupin c8000v 1 3

  • This example shows the KVM commands needed if you have a Cisco Catalyst 8000V configuration with four vCPUs and the host has eight cores:

    virsh vcpupin c8000v 0 2

    virsh vcpupin c8000v 1 3

    virsh vcpupin c8000v 2 4

    virsh vcpupin c8000v 3 5

    The host core number can be any value from 0 to 7. For more information, refer to the official KVM documentation.

Note
When you configure CPU pinning, consider the CPU topology of the host server. If you are using a Cisco Catalyst 8000V instance with multiple cores, do not configure CPU pinning across multiple sockets.

BIOS settings

Optimize the performance of the KVM configuration by applying the recommended BIOS settings listed in this table.

Configuration

Recommended setting

Intel Hyper-Threading Technology

Disabled

Number of Enable Cores

ALL

Execute Disable

Enabled

Intel VT

Enabled

Intel VT-D

Enabled

Intel VT-D coherency support

Enabled

Intel VT-D ATS support

Enabled

CPU Performance

High throughput

Hardware Prefetcher

Disabled

Adjacent Cache Line Prefetcher

Disabled

DCU Streamer Prefetch

Disable

Power Technology

Custom

Enhanced Intel Speedstep Technology

Disabled

Intel Turbo Boost Technology

Enabled

Processor Power State C6

Disabled

Processor Power State C1 Enhanced

Disabled

Frequency Poor Override

Enabled

P-State Coordination

HW_ALL

Energy Performance

Performance

Host OS settings

Cisco recommends that you use hugepages and enable emulator pinning on the host. These actions are recommended on the host.

  • Enable IOMMU=pt

  • Enable intel_iommu=on

  • Enable hugepages

  • Use SR-IOV if your system supports it for higher networking performance. Check the SR-IOV limitations your system might have.

In addition to enabling hugepages and emulator pinning, configure: nmi_watchdog=0 elevator=cfq transparent_hugepage=never

Note

If you use Virtio VHOST USER with VPP or OVS-DPDK, you can increase the buffer size to 1024 (rx_queue_size='1024' ) provided the version of your QEMU supports it.

IO Settings

You can use SR-IOV to enhance performance. However, this may introduce limitations such as the number of virtual functions (VF), OpenStack limitations for SR-IOV like QoS support, live migration, and security group support.

If you use a modern vSwitch such as fd.io VPP or OVS-DPDK, reserve at least two cores for the VPP worker threads or the OVS-DPDK PMD threads.

Configure these parameters to run the VPP through command line.

Parameter

Description and notes

-cpu host

This parameter causes the VM to inherit the host OS flags. You need libvirt version 0.9.11 or later for this feature to be available in the XML configuration.

-m 8192

Requires 8GB RAM for optimal zero packet drop rates.

rombar=0

Disables PXE boot delays. Set rombar=0 to the end of each device option list or add "<rom bar=off />" to the device xml configuration.


KVM halt polling

halt_poll_ns is a KVM module parameter that allows you to alter the behaviour of how idle KVM guest virtual CPUs (vcpus) are handled.

When a virtual CPU in a KVM guest has no threads to run, QEMU traditionally halts the idle CPU. By default, this setting specifies a period of 400 nanoseconds during which a virtual CPU waits and polls before entering a CPU Idle state.

When new work arrives during the polling period, before the vCPU is halted, the vCPU is immediately ready to execute the work. If the vCPU has already entered the idle state when new work arrives, it must be brought out of the idle state before starting the new task. The transition from idle to running state causes additional latency, which can negatively affect latency-sensitive workloads.

With the default kernel parameters, the guest Cisco Catalyst 8000V router CPU consumes all the available resources on the host CPU.


Configure KVM halt polling

Configure the halt_poll_ns parameter in KVM to improve performance.

You can configure halt_poll_ns in two ways:

  • Large halt_poll_ns: n this case, more CPU time is spent busy-spinning for events that wake the virtual CPU, and fewer ACPI deep sleep cycles occur. This means more power is consumed. However, there are fewer wakeups from deep sleep states. Depending on the configured state, this can cause issues such as cache misses.

  • Small halt_poll_ns: In this case, less CPU time is spent busy-spinning for events that wake the CPU, and more ACPI deep sleep cycles occur. This results in lower power consumption, but more wakeups from deep sleep states are required. Increased wakeups can lead to many deep sleep instances. Depending on the configuration, this can cause many cache misses and longer wakeup times.

Procedure

1.

At run time, run echo 0 > /sys/module/kvm/parameters/halt_poll_ns.

2.

To load the module, perform this configuration.

 # rmmod kvm_intel
 # rmmod kvm
 # modprobe kvm halt_poll_ns=0
 # mpdprobe kvm_intel
3.

When you boot the device, add kvm.halt_poll_ns=<specify value> in the parameters section of grub2.