-
Traditional Physical Server NIC RSS Technology
-
How Hyper-V VMQ Works
-
What are the Functions of VMQ?
-
Dynamic VMQ vs. Static VMQ
-
How to Manage Virtual Machine Queues?
-
Backup Hyper-V VM with Vinchin Solution
-
Hyper-v Virtual Machine Queue FAQs
-
Conclusion
In modern data center network architecture, efficient utilization of multi-core CPUs and network performance optimization in virtualized environments have always been core technological challenges. Traditional physical servers use RSS technology on NICs to intelligently distribute network traffic across multiple CPU cores, significantly improving network throughput and CPU utilization. However, the introduction of virtualization has made network traffic paths more complex—physical NICs must serve both the host machine and multiple VMs simultaneously, making it difficult for traditional RSS technology to directly adapt to the layered architecture of virtual switches. To address this, the Hyper-V virtualization platform introduced Virtual Machine Queue (VMQ) technology, which inherits the multi-core load balancing concept of RSS while optimizing it for virtualization scenarios.
Traditional Physical Server NIC RSS Technology
Before introducing VMQ, let’s first look at how a NIC receives network data on a traditional physical server. When multi-core CPUs were introduced, NICs initially did not support distributing network traffic interrupts across multiple logical cores, instead handling them on a single logical core. This led to uneven CPU utilization and reduced efficiency in processing network traffic. Today, most NICs support RSS, which allows NICs with multiple hardware receive queues to distribute received data across multiple queues. On multi-core physical servers, RSS technology directs interrupts from these queues to different CPU logical cores, thereby improving data reception efficiency. The goal of RSS is to assign queues to the optimal CPU logical core, balancing the CPU overhead of network traffic.
How Hyper-V VMQ Works
The situation in a virtualized environment is more complex than in a physical environment. First, when a physical NIC is transformed into a virtual switch, it loses its RSS functionality. Second, since multiple VMs run on the physical host and share the same NIC to receive packets, an equally effective method is needed to balance network-related CPU overhead while ensuring VM network performance. This is where VMQ comes in. VMQ is a special queue that functions similarly to hardware queues on NICs and uses a mechanism similar to RSS to distribute queue interrupts across different CPU logical cores. However, the logic for packet filtering and assignment in VMQ differs from that of hardware queues. In a purely physical environment, the physical NIC only considers its own data queue, whereas in a virtualized environment, the virtual switch must balance queues for both the physical host and VMs.
Before explaining the working principle of VMQ, let’s first understand the routing path of packets within a virtual switch. The Hyper-V virtual switch has two types of queues—VMQ and the default queue. Data in the default queue goes through several stages, including virtual switch routing, filtering, extensions, access control lists, and forwarding paths, before finally being distributed via the virtual machine bus.
VMQ first collect the MAC addresses of virtual NICs (vNICs) in VMs before distributing them into queues using a VMQ MAC filter for VMs that have VMQ enabled. VMs without VMQ enabled, or those whose traffic does not match the VMQ MAC filter, remain in the default queue. Unlike the default queue, which follows the complete routing, filtering, extension, access control, and forwarding path, VMQ bypass some of these steps and transmit data to the VM bus with minimal routing overhead. Once the data reaches the VM bus, the vNIC in the VM uses Virtual RSS (vRSS) technology to distribute queue interrupts to virtual CPUs.
What are the Functions of VMQ?
If VMQ is enabled on the vNIC, the virtual switch bypasses multiple layers of routing code, ensuring that data is forwarded to the VM quickly and accurately. Compared to a scenario without VMQ, this not only reduces CPU resource consumption for routing but also lowers data transmission latency.
VMQ provides the following functionalities:
Improves network throughput by distributing the network traffic of multiple VMs across multiple processors.
Note: In Hyper-V, sub-partitions are also referred to as VMs.
Reduces CPU usage by offloading packet filtering tasks to NIC hardware.
Prevents network data duplication by using DMA to transfer data directly to VM memory.
Segments network data to provide a secure environment.
Supports live migration.
Dynamic VMQ vs. Static VMQ
VMQ can be categorized as either dynamic or static. Static VMQ means that the association between VMQ and CPU logical cores is fixed. For example, the VMQ assigned to VM1 is mapped to logical CPU1, while the VMQ assigned to VM2 is mapped to logical CPU2. This mapping remains unchanged throughout the lifecycle of VM1 and VM2, meaning that VM1’s data is always handled by logical CPU1, and VM2’s data is by logical CPU2. However, in cases where the CPU handling a VM’s network traffic becomes busy, static VMQ may slow down network processing for that VM.
To address this issue, starting with Windows Server 2012 R2, dynamic VMQ was introduced. Dynamic VMQ is more intelligent—unlike static VMQ, it allows VM network processing to dynamically adjust based on load and the associated logical CPU. If logical CPU2 is relatively idle, both VM1 and VM2’s queues can be associated with logical CPU2.
How to Manage Virtual Machine Queues?
Enabling or disabling VMQ for a VM is straightforward. By default, Hyper-V enables VMQ. However, it can be enabled or disabled based on the VM’s requirements and the actual performance of the NIC. In some cases, VMQ may cause significant network performance degradation for VMs. If such issues occur, VMQ can be disabled on the host NIC by following these steps:
1. Open the host’s management tool—Computer Management, navigate to Device Manager, and expand the list of Network Adapters.
2. Right-click the physical NIC associated with Hyper-V, then select Properties.
3. In the NIC properties dialog box, switch to the Advanced tab, locate the Virtual Machine Queue option in the property list, change its value to Disabled, and click OK.
If there are too many VMs and insufficient VMQ queues on the NIC, VMQ weights can be assigned to prioritize network data processing. VMs with higher weights will have priority in the VMQ, and vice versa. By default, the VMQ weight is set to 100, as shown in the example below:
PS C:\> Get-VMNetworkAdapter -VMName VM01 | fl VMQweight VMQWeight : 100
To change the VMQ weight for a VM, use the following PowerShell command:
PS C:\> Get-VMNetworkAdapter -VMName vmname -VMQweight 50
Backup Hyper-V VM with Vinchin Solution
In certain scenarios, professional backup software such as Vinchin Backup & Recovery may provide more optimized performance and more advanced features.
Vinchin Backup & Recovery is an advanced data protection solution that supports a wide range of popular virtualization platforms, including VMware, Hyper-V, XenServer, Red Hat Virtualization, Oracle, Proxmox, etc., and database, NAS, file server, Linux & Windows Server. It provides advanced features like agentless backup, forever incremental backup, V2V migration, instant restore, granular restore, backup encryption, compression, deduplication, and ransomware protection. These are critical factors in ensuring data security and optimizing storage resource utilization.
It only takes 4 steps to backup your Hyper-V VMs with Vinchin Backup & Recovery:
1.Select the backup object.
2.Select backup destination.
3.Configure backup strategies.
4.Review and submit the job.
Discover the power of this comprehensive system firsthand with a free 60-day trial! Leave your specific needs, and you will get a customized solution that fits your IT environment perfectly.
Hyper-v Virtual Machine Queue FAQs
1. What is VMMQ?
Virtual Machine Multi-Queue (VMMQ) improves VMQ by distributing network traffic across multiple CPU cores, enhancing performance for high-bandwidth workloads on 10GbE+ NICs.
2. How many RSS queues should I use?
The number of Receive Side Scaling (RSS) queues you should use depends on your network adapter, CPU cores, and workload. Use the same or fewer RSS queues than available CPU cores to avoid excessive context switching.
Conclusion
VMQ technology extends the hardware queue logic of physical NICs into the virtualization layer, enabling efficient distribution of VM network traffic and balancing CPU load. Its core value lies in bypassing the complex routing path of virtual switches while leveraging dynamic queue allocation mechanisms to reduce network latency and improve throughput in multi-VM concurrent environments. Although improper configuration of VMQ may lead to performance issues in certain scenarios, its features make it a critical technology for building high-performance virtualized networks.
Share on: