Elastic Cloud Server

Enable NIC multi-queue

2025-11-25 03:23:10

Scenario

As the bandwidth of network IO continues to increase, there is a bottleneck for single core CPUs to handle network interrupts, which cannot fully meet the needs of NIC. By enabling the NIC multi-queue function, you can distribute the NIC interrupts in the Elastic Cloud Server to different CPUs to meet the needs of NIC, thereby improving network PPS and bandwidth performance.

Assuming that the Elastic Cloud Server described in the following scenario meets the requirements of specifications and virtualization types:

· For the Elastic Cloud Servers created using public images in the NIC multi-queue support list, NIC multi-queue is enabled by default, the operation in this section is unnecessary.

· For private image scenarios, if the operating system of your external image file is within the NIC multi-queue support list, you need to enable NIC multi-queue according to the following process:
a. Import an external image file to the Image Management Service console.
b. Create an Elastic Cloud Server using the private image.
c. Execute the NIC multi-queue configuration script.

            

Description        

After enabling the NIC multi queue function on the cloud server, if you need add or delete NIC or switch VPCs later, it is necessary to reset the NIC multi queue on the cloud server.


NIC Multi-Queue Support List

The support of NIC multi-queue is related to the instance specification, virtualization type, and the operating system of the image, and only when these requirements are met at the same time, can the ECS multi-queue function be enabled.

· For the specifications of supporting NIC multi-queue, see ECS - Product Specifications, and if the number of NIC multi-queues is greater than 1, it means that multi-queue is supported.

Multi-queue support list for Windows ECS NICs

Image

Whether to support multiple queues

Whether to enable multiple queues by default

Windows Server 2008 R2 Standard/Enterprise 64bit

Yes

Yes

Windows Server 2012 R2 Standard/DataCenter 64 bit

Yes

Yes

Windows Server 2016 Standard/DataCenter 64 bit

Yes

Yes

Windows Server 2019 DataCenter 64 bit

Yes

Yes


Multi-queue support list for Linux ECS NICs

Image

Whether to support multiple queues

Whether to enable multiple queues by default

Ubuntu 16.04/18.04/20.04/22.04 server 64bit

Yes

Yes

CentOS 6.8/7.*/8.*64bit

Yes

Yes

Debian 9.0.0 64bit

Yes

Yes

Fedora CoreOS 36 64bit

Yes

Yes

openEuler 20.03 64bit

Yes

Yes

CTyunOS 2.0.1/3-23.01 64bit

Yes

Yes

AnolisOS 7.9/8.4 64bit

Yes

Yes

Import an external image file to the Image Management Service console

For details about how to import an external image file to the Image Management Service console, see Image Management Service - User Guide.

Create an Elastic Cloud Server using the private image

Create an Elastic Cloud Server using the registered private image. When configuring parameters, it is important to pay attention to the following two points:

· Region: The region where the private image is located must be selected.

· Image: Select Private Image and select the desired image from the drop-down list.

Execute the NIC multi-queue configuration script

The semi-virtualized driver pvdriver used by Windows OS has a set of policies to dynamically adjust the number of queues for the NICs, it will calculate the number of queues based on the number of vCPUs and adjust it dynamically, so there is no need to set the number of multiple queues for Windows NICs.

The Linux OS provides the configuration script for automatically enabling the NIC multi-queue function, after the configuration is successful, the ECS supports this function.

Download the configuration script "multi-queue-ctyun".

Download Address:https://multi-queue.obs.cn-jssz1.ctyun.cn/multi-queue-ctyun

Execute the following command to add execution permissions.

chmod +x multi-queue-ctyun

Execute the following command to place the script "multi-queue-ctyun" in the directory /etc/init.d.

mv multi-queue-ctyun /etc/init.d

Execute the following command to run the script "multi-queue-ctyun".

/etc/init.d/multi-queue-ctyun start

Run the script for immediate effect. However, after shutdown, the multi-queue function of the NIC will automatically become invalid.

To enable the NIC multi-queue function to automatically take effect upon startup, you need to add the following startup configurations for each OS:

− CentOS/Redhat/Fedora/EulerOS/Suse/OpenSuse Use the following command to add the startup items to enable the NIC to be configured for multi-queue startup:

chkconfig multi-queue-ctyun on

− Ubuntu Use the following command to add startup items:

update-rc.d multi-queue-ctyun defaults 90 10

− Debian Use the following command to add startup items:

systemctl enable multi-queue-ctyun

View the number of NIC queues

1. Enable the NIC multi-queue function

2. Log in to the ECS.

3. Execute the following command to view the number of queues supported and enabled by the NIC.

ethtool -l NIC

Example:

[root@localhost ~]# ethtool -l eth0 #Query the number of queues for NIC eth0

Channel parameters for eth0:

 

Pre-set maximums: 

RX:               0

TX:               0

Other:                  0

Combined: 4 #Indicates that this NIC supports setting up to 4 queues to be enabled.

Current hardware settings:

RX:               0

TX:               0

Other:                  0

Combined: 4 #Indicates that 4 queues are currently enabled


YfSF2rM5.5E.