VK Cloud logo
Updated atMarch 27, 2024   03:20 PM

Enabling multiple queues (multiqueue) on Linux

VK Cloud supports multiple queues (multiqueue) for a VM image and a separate VM for Linux operational systems.

Constraints

The virtio-net multiqueue function provides performance improvement, but it has some limitations:

  • Guest OS is limited to ~200 MSI vectors. Each NIC queue requires a MSI vector, as well as any virtio device or assigned PCI device. Defining an instance with multiple virtio NICs and vCPUs might lead to a possibility of hitting the guest MSI limit.
  • Virtio-net multiqueue works well for incoming traffic, but can occasionally cause a performance degradation, for outgoing traffic.
  • Enabling virtio-net multiqueue increases the total network throughput, but in parallel it also increases the CPU consumption.
  • Enabling virtio-net multiqueue in the host QEMU config, does not enable the functionality in the guest OS. The guest OS administrator needs to manually turn it on for each guest NIC that requires this feature, using ethtool.
  • MSI vectors would still be consumed (wasted), if multiqueue was enabled in the host, but has not been enabled in the guest OS by the administrator.
  • In case the number of vNICs in a guest instance is proportional to the number of vCPUs, enabling the multiqueue feature is less important.

1. Enable multiqueue

The option includes multiqueue at the image level and will work for all VMs created after executing the instruction.

  1. Create image VM.

  2. Get a list of available images:

    openstack image list
  3. Copy the ID of the desired image.

  4. Enable multiqueue:

    openstack image set <IMG_ID> --property hw_vif_multiqueue_enabled=true

2. Check the multiqueue connection

  1. Create a VM with more than one CPU, and connect to it.

  2. View all network interfaces:

    sudo ip link show
  3. See the current number of queues:

    ethtool -l <network interface name>

3. Set the desired number of queues for the VM

  1. Create a VM and connect to it.

  2. Run the command:

    sudo ethtool -L <network interface name> combined <number of queues>
  3. Check the new number of queues (parameter Combined):

    ethtool -l <network interface name>