NIC multi-queue enables an ECS instance to use more than one NIC queues to increase the packet forwarding rate. Handling interrupts with the vCPUs of a single instance is prone to performance bottlenecks. Multiple NIC queues can distribute interrupts to different CPUs for handling to achieve higher network performance.

Prerequisites

  • The current instance type must support the NIC multi-queue feature. For more information about instance types that support the NIC multi-queue feature, see Instance families. If the value of NIC queues is greater than 1, it indicates that the NIC multi-queue feature is supported.
  • The following public images provided by Alibaba Cloud support the NIC multi-queue feature. The support of this feature is irrelevant to the bit sizes of the operating systems.
    Note Even if your operating system is included in the list, early versions of public images may not have supported the NIC multi-queue feature until later updates. We recommend that you use the latest public images. If your image has the NIC multi-queue feature enabled by default, skip this section.
    Public image NIC multi-queue supported NIC multi-queue enabled
    CentOS 6.8, 6.9, 7.2, 7.3, and 7.4 Yes Yes
    Ubuntu 14.04, 16.04, and 18.04 Yes Yes
    Debian 8.9 and 9.2 Yes Yes
    SUSE Linux Enterprise Server 12 SP1 Yes Yes
    SUSE Linux Enterprise Server 12 SP2 Yes Yes
    Red Hat Enterprise Linux 6.9, 7.4, and 7.5 Yes No
    openSUSE 42.3 Yes No
    Aliyun Linux 2.1903 Yes Yes
    Aliyun Linux 17.1 Yes No
    Windows Server 2012 R2 Yes Yes
    Windows Server 2016 Yes Yes

Background information

NIC multi-queue is a technology that can fix the Quality of Service (QoS) issue of I/O bandwidth. The NIC multi-queue driver binds NIC queues to different cores through interrupts. This solves processing bottlenecks of single-core CPUs when network I/O bandwidth increases, and improves the packet forwarding rate and bandwidth performance. Under identical packet forwarding rate and network bandwidth conditions, the performance of two queues can be 50% to 100% higher than that of a single queue, and the performance of four queues can be even higher.

The following procedure applies only to Linux instances.

Automatic configuration

  1. Remotely connect to an ECS instance. For more information, see Overview.
  2. Download the script package for automatic configuration.
    wget https://image-online.oss-cn-hangzhou.aliyuncs.com/doc/ecs_mq_20200102-1038.tgz
  3. Extract the script.
    tar -xzf ecs_mq_20200102-1038.tgz
  4. Change the working path.
    cd ecs_mq/
  5. Run the script.
    The script format varies with the image versions. For example, bash install.sh centos 7 is suitable for CentOS 7.6 images.
    bash install.sh <System name> <Major version number of the system>

Manual configuration

This section uses CentOS 7.6 images as an example. The name of the primary NIC is eth0, and the name of the secondary ENI is eth1. This section describes how to manually configure NIC multi-queue.

  1. Run the ethtool -l eth0 command to check whether the primary NIC supports NIC multi-queue.
    [root@localhost ~]# ethtool -l eth0
    Channel parameters for eth0:
    Pre-set maximums:
    RX: 0
    TX: 0
    Other: 0
    Combined: 2 # This value indicates that a maximum of two queues can be configured.
    Current hardware settings:
    RX: 0
    TX: 0
    Other: 0
    Combined: 1 # This value indicates that one queue is currently taking effect.
    Note If the returned values of the two Combined fields are same, it indicates that the NIC multi-queue feature is enabled.
  2. Run the ethtool -L eth0 combined 2 command to enable the NIC multi-queue feature.
    [root@localhost ~]# ethtool -L eth0 combined 2
    This command configures the eth0 primary NIC to use two queues.
  3. Configure NIC multi-queue for the secondary ENI.
    # Check whether the eth1 secondary ENI supports NIC multi-queue.
    [root@localhost ~]# ethtool -l eth1
    Channel parameters for eth1:
    Pre-set maximums:
    RX: 0
    TX: 0
    Other: 0
    Combined: 4 # This value indicates that a maximum of four queues can be configured.
    Current hardware settings:
    RX: 0
    TX: 0
    Other: 0
    Combined: 1 # This value indicates that one queue is currently taking effect.
    # Configure the eth1 secondary ENI to use four queues.
    [root@localhost ~]# ethtool -L eth1 combined 4