Configuring the VM NIC
When a VM uses the NIC passthrough function, you can adjust the number of NIC queues and binding interrupts to CPUs to achieve optimal network performance and prevent the network from becoming a performance bottleneck.
Adjusting the Number of NIC Queues
- Run the following command on the VM to query the number of NIC queues:
1ethtool -l eth1

The preceding information shows that there are 63 queues.
- Run the top command to check the CPU usage for processing software interrupts. If the number of queues is insufficient, the CPU usage for processing software interrupts is 100%. In this case, you need to add queues.
- Dynamically adjust the number of queues based on the performance. For example, run the following command to change the number of queues to 48:
1ethtool -L eth1 combined 48
More queues do not necessarily mean better performance. You need to observe the CPU usage for processing software interrupts to determine whether a performance bottleneck exists.
Binding NIC Interrupts to CPUs
You are advised to bind interrupts to vCPUs of the NUMA node where the physical NIC resides. You can run the following command on the host to view the NUMA node where the NIC resides:
1 | cat /sys/bus/pci/devices/0000\:03\:00.0/numa_node |
- Disable the irqbalance service on the VM.
1 2
service irqbalance status service irqbalance stop
- Run the following command to query the NIC interrupt ID:
1cat /proc/interrupts | grep eth1
eth1 is the network port name.
- Manually bind NIC interrupts to different CPUs.
1echo 2 > /proc/irq/xxx/smp_affinity_list
Parent topic: Tuning the Virtualization Settings