How Do I Enable NIC Multi-Queue for an Image?
Scenarios
With the increase of network I/O bandwidth, a single vCPU cannot meet the requirement of processing NIC interruptions. NIC multi-queue allows multiple vCPUs to process NIC interruptions, thereby improving network PPS and I/O performance.
ECSs Supporting NIC Multi-Queue
NIC multi-queue can be enabled on an ECS only when the ECS specifications, virtualization type, and image meet the requirements described in this section.
- For details about the ECS specifications that support NIC multi-queue, see ECS Types.
If the number of NIC queues is greater than 1, NIC multi-queue is supported.
- Only KVM ECSs support NIC multi-queue.
- The Linux public images listed in Table 2 support NIC multi-queue.
- Windows OSs have not commercially supported NIC multi-queue. If you enable NIC multi-queue for a Windows image, starting an ECS created using such an image may be slow.
- You are advised to upgrade the kernel version of Linux ECSs to 2.6.35 or later. Otherwise, NIC multi-queue is not supported.
Run the uname -r command to check the kernel version. If the version is earlier than 2.6.35, contact technical support to upgrade it.
OS |
Image |
Supported By |
---|---|---|
Windows |
Windows Server 2008 WEB R2 64bit |
Private images |
Windows Server 2008 Enterprise SP2 64bit |
Private images |
|
Windows Server 2008 R2 Standard/Datacenter/Enterprise 64bit |
Private images |
|
Windows Server 2008 R2 Enterprise 64bit_WithGPUdriver |
Private images |
|
Windows Server 2012 R2 Standard 64bit_WithGPUdriver |
Private images |
|
Windows Server 2012 R2 Standard/Datacenter 64bit |
Private images |
OS |
Image |
Supported By |
NIC Multi-Queue Enabled by Default |
---|---|---|---|
Linux |
Ubuntu 14.04/16.04 Server 64bit |
Public images |
Yes |
openSUSE 42.2 64bit |
Public images |
Yes |
|
SUSE Enterprise 12 SP1/SP2 64bit |
Public images |
Yes |
|
CentOS 6.8/6.9/7.0/7.1/7.2/7.3/7.4/7.5/7.6 64bit |
Public images |
Yes |
|
Debian 8.0.0/8.8.0/8.9.0/9.0.0 64bit |
Public images |
Yes |
|
Fedora 24/25 64bit |
Public images |
Yes |
|
EulerOS 2.2 64bit |
Public images |
Yes |
Operation Instructions
Assume that an ECS has the required specifications and virtualization type.
- If the ECS was created using a public image listed in ECSs Supporting NIC Multi-Queue, NIC multi-queue has been enabled on the ECS by default. Therefore, you do not need to manually enable NIC multi-queue for it.
- If the ECS was created using an external image file with an OS listed in ECSs Supporting NIC Multi-Queue, perform the following operations to enable NIC multi-queue:
Currently, NIC multi-queue is only available for Ethernet NICs.
Register the External Image File as a Private Image
- If the value is Supported, go to Create an ECS from the Private Image.
- If the value is Not supported, go to Set NIC Multi-Queue for the Image.
Set NIC Multi-Queue for the Image
Windows OSs have not commercially supported NIC multi-queue. If you enable NIC multi-queue for a Windows image, starting an ECS created using such an image may be slow.
Use either of the following methods to set NIC multi-queue.
- Access the IMS console.
- Log in to the management console.
- Under Compute, click Image Management Service.
The IMS console is displayed.
- On the displayed Private Images page, locate the row that contains the target image and click Modify in the Operation column.
- Set NIC multi-queue for the image.
- Access the IMS console.
- Log in to the management console.
- Under Compute, click Image Management Service.
The IMS console is displayed.
- On the displayed Private Images page, click the name of the target image.
- In the upper right corner of the displayed image details page, click Modify. In the displayed Modify Image dialog box, set NIC multi-queue for the image.
Method 3: Add hw_vif_multiqueue_enabled to the image using an API.
- Obtain a token. For details, see Authentication.
- Call an API to update image information. For details, see Updating Image Information (Native OpenStack API).
- Add X-Auth-Token to the request header.
The value of X-Auth-Token is the token obtained in step 1.
- Add Content-Type to the request header.
The value of Content-Type is application/openstack-images-v2.1-json-patch.
The request URI is in the following format:
PATCH /v2/images/{image_id}
The request body is as follows:[ { "op":"add", "path":"/hw_vif_multiqueue_enabled", "value": "true" } ]
Figure 1 shows an example request body for setting NIC multi-queue.
Create an ECS from the Private Image
- Region: Select the region where the private image is located.
- Image: Select Private image and then the desired image from the drop-down list.
Run the Script for Configuring NIC Multi-Queue
Windows OSs have not commercially supported NIC multi-queue. If you enable NIC multi-queue for a Windows image, starting an ECS created using such an image may be slow.
For Linux OSs, the script for automatically configuring NIC multi-queue is provided. If an ECS has multiple NICs, running the script will automatically enable multi-queue for all the NICs.
- Log in to the ECS and run the following command to check the number of queues supported by and enabled for a NIC:
Example:
[root@localhost ~]# ethtool -l eth0 #View the number of queues used by NIC eth0. Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 4 #The NIC supports a maximum of four queues. Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 1 #One queue has been enabled for the NIC.
If the values of the two Combined fields are the same, NIC multi-queue has been enabled. No further action is required.
- Run the following command to download the configuration script multi-queue-hw:
wget https://ecs-instance-driver.obs.cn-north-1.myhuaweicloud.com/multi-queue-hw
The download path is https://ecs-instance-driver.obs.cn-north-1.myhuaweicloud.com/multi-queue-hw.
- Run the following command to make the script executable:
- Run the following command to place the multi-queue-hw script in the /etc/init.d directory:
mv multi-queue-hw /etc/init.d
Enter y when the following information is displayed:
mv: overwrite '/etc/init.d/multi-queue-hw'?
- Run the following command to run the script:
/etc/init.d/multi-queue-hw start
NIC multi-queue script takes effect immediately after the script is executed but becomes invalid once the ECS stops.
- Add a startup item for each OS so that NIC multi-queue is automatically enabled upon the ECS startup.
- For CentOS, Red Hat, Fedora, EulerOS, SUSE, and openSUSE, run the following command:
Image Optimization FAQs
- Must I Install Guest OS Drivers on an ECS?
- Why Do I Need to Install and Update VirtIO Drivers for Windows?
- What Will the System Do to an Image File When I Use the File to Register a Private Image?
- How Do I Configure an ECS, BMS, or Image File Before I Use It to Create an Image?
- What Do I Do If a Windows Image File Is Not Pre-Configured When I Use It to Register a Private Image?
- What Do I Do If a Linux Image File Is Not Pre-Configured When I Use It to Register a Private Image?
- How Do I Optimize an Image?
- How Do I Use a Private Image Created from a First-Generation ECS to Create a Second-Generation ECS?
- How Do I Enable NIC Multi-Queue for an Image?
- How Do I Configure an ECS to Dynamically Acquire IPv6 Addresses?
- How Do I Make a System Disk Image Support Fast ECS Creation?
- Whey Do I Fail to Install Guest OS Drivers on a Windows ECS?
- How Do I Install Native Xen and KVM Drivers?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore