All Products
Search
Document Center

Elastic Compute Service:Configure NIC multi-queue

Last Updated:Sep 22, 2023

Network interface controller (NIC) multi-queue allows Elastic Compute Service (ECS) instance types to support multiple separate traffic queues on each NIC. NIC multi-queue is introduced to resolve performance bottlenecks that occur when network interrupts are handled by a single vCPU. NIC multi-queue provides multiple NIC queues, distributes network interrupts to each of the queues, and balances the queues over multiple vCPUs to improve network performance and response time. This topic describes how to configure NIC multi-queue.

Prerequisites

  • The NIC multi-queue feature is supported by the instance type of your instance.

    For information about the instance types that support NIC multi-queue, see Overview of instance families. If the number of NIC queues is greater than one for an instance type, NIC multi-queue is supported by the instance type.

    Note

    If network interrupts are not distributed to different vCPUs in a re6p persistent memory-optimized instance, we recommend that you upgrade the ecs_mq configuration script to the most recent version.

  • The NIC multi-queue feature is supported by the image of your instance.

    Note
    • Specific early public images may not support the NIC multi-queue feature. We recommend that you use the most recent public images. If NIC multi-queue is enabled in the image that is used by your instance by default, skip the operations that are described in this topic.

    • The operations that are described in this topic apply only to Linux ECS instances. By default, NIC multi-queue is enabled on ECS instances that run Windows 2012 or later without the need for additional configurations.

    Alibaba Cloud provides public images that support NIC multi-queue. The following table describes the public images. Take note that NIC multi-queue is supported regardless of the bit sizes of the OSs that are contained in the images.

    Public images

    Public image

    NIC multi-queue supported

    NIC multi-queue enabled

    CentOS 6.9/6.10/7.*/8.*

    Yes

    Yes

    Ubuntu 14.04/16.04/18.04/20.04/22.04

    Yes

    Yes

    Debian 8.9/9.*/10.*/11.*

    Yes

    Yes

    SUSE Linux Enterprise Server 12 SP*/15 SP*

    Yes

    Yes

    Red Hat Enterprise Linux 7.*/8.*/9.*

    Yes

    No

    OpenSUSE 42.3/15.*

    Yes

    No

    Alibaba Cloud Linux 2.1903/3.2104

    Yes

    Yes

    Windows 2012 and later

    Yes

    Yes

Background information

NIC multi-queue is a technology that is used to resolve I/O bandwidth Quality of Service (QoS) issues. When all network interrupts are handled by a single vCPU, network performance is restricted and does not scale as I/O bandwidth increases. NIC multi-queue drivers remove this bottleneck by binding separate NIC queues to different vCPUs to improve network packet forwarding rates and enhance bandwidth performance. Test results indicate that under identical packet forwarding rate and network bandwidth conditions, two queues achieve a performance that is 50% to 100% higher than the performance of a single queue. Performance can be significantly improved by using four queues.

Procedure

(Recommended) Automatic configuration

  1. Connect to a Linux instance.

    For more information, see Connect to a Linux instance by using a password or key.

  2. Run the following command to download the package of the ecs_mq automatic configuration script:

    wget https://ecs-image-tools.oss-cn-hangzhou.aliyuncs.com/ecs_mq/ecs_mq_latest.tgz
  3. Run the following command to extract the ecs_mq script from the package:

    tar -xzf ecs_mq_latest.tgz
  4. Run the following command to switch the working directory:

    cd ecs_mq/
  5. Run the following command to run the ecs_mq script.

    Note

    Replace <Operating system name> and <Major version number of the operating system> in the following command with actual values. The command format varies based on the image version. For example, use the bash install.sh centos 7 command for CentOS 7.6 images.

    bash install.sh <Operating system name> <Major version number of the operating system>
  6. Run the following command to enable NIC multi-queue:

    systemctl start ecs_mq

Manual configuration

This section describes how to manually configure NIC multi-queue. In this example, an instance that runs CentOS 7.6 is used. The instance has a primary elastic network interface (ENI) named eth0 and a secondary ENI named eth1.

  1. Connect to a Linux instance.

    For more information, see Connect to a Linux instance by using a password or key.

  2. Run the following command to check whether NIC multi-queue is enabled on the primary ENI:

    ethtool -l eth0

    If the values of the Combined fields in the command output are the same, NIC multi-queue is enabled on the ENI. If the values of the fields are different, proceed to the next step.

    Channel parameters for eth0:
    Pre-set maximums:
    RX: 0
    TX: 0
    Other: 0
    Combined: 2 # This value indicates that the ENI supports up to two queues.
    Current hardware settings:
    RX: 0
    TX: 0
    Other: 0
    Combined: 1 # This value indicates that one queue is in effect on the ENI.
  3. Run the following command to enable NIC multi-queue and two queues on the primary ENI:

    ethtool -L eth0 combined 2
  4. Run the following command to check whether NIC multi-queue is enabled on the secondary ENI:

    ethtool -l eth1

    If the values of the Combined fields in the command output are the same, NIC multi-queue is enabled on the ENI. If the values of the fields are different, proceed to the next step.

    Channel parameters for eth1:
    Pre-set maximums:
    RX: 0
    TX: 0
    Other: 0
    Combined: 4 # This value indicates that the ENI supports up to four queues.
    Current hardware settings:
    RX: 0
    TX: 0
    Other: 0
    Combined: 1 # This value indicates that one queue is in effect on the ENI.
  5. Run the following command to enable NIC multi-queue and four queues on the secondary ENI:

    ethtool -L eth1 combined 4