How Do I Enable NIC Multi-Queue for an Image?
Scenarios
Network I/O bandwidth can keep increasing to the point where a single vCPU cannot process all of the NIC interrupts. NIC multi-queue allows multiple vCPUs to process NIC interrupts, thereby improving network PPS and I/O performance.
ECSs Supporting NIC Multi-Queue
NIC multi-queue can only be enabled on an ECS with the specifications and virtualization type described in this section.
- For details about the ECS specifications that support NIC multi-queue, see ECS Types.
If there are more than 1 NIC queue, NIC multi-queue is supported.
- Only KVM ECSs support NIC multi-queue.
Operation Instructions
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 Enable NIC Multi-Queue for the Image.
Enable NIC Multi-Queue for the Image
Use any of the following methods to enable NIC multi-queue for an 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, locate the row that contains the image and click Modify in the Operation column.
- Enable 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 image.
- In the upper right corner of the displayed image details page, click Modify. In the displayed Modify Image dialog box, enable 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.
Set Content-Type to 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 } ]
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 a Script to Enable NIC Multi-Queue on the ECS
For Linux, a script is provided to automatically enable NIC multi-queue. If an ECS has multiple NICs, the script will automatically enable multi-queue for all of them.
- Log in to the ECS and run the following command to check the number of queues supported by and enabled for a NIC:
Example output:
[root@localhost ~]# ethtool -l eth0 # 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.
- Download the configuration script multi-queue-hw.
wget https://ecs-instance-driver.obs.cn-north-1.myhuaweicloud.com/multi-queue-hw
The download address is https://ecs-instance-driver.obs.cn-north-1.myhuaweicloud.com/multi-queue-hw.
- Make the script executable.
- Move the multi-queue-hw script into the /etc/init.d directory.
mv multi-queue-hw /etc/init.d
Enter y when prompted:
mv: overwrite '/etc/init.d/multi-queue-hw'?
- Run the script.
/etc/init.d/multi-queue-hw start
NIC multi-queue is enabled immediately after the script is executed but is disabled again if the ECS stops.
- Enable NIC multi-queue at startup.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.