Product Announcements

Virtual Switch Performance and Overhead

I’ve seen a few emails from our field fly by recently on the subject of virtual switch performance in ESX. It seems a few folks are operating under the impression that more vswitches equates to better performance (note: it doesn’t). Mark Pariente, one of senior engineers gave me some more detail. Here is his explanation:

It is a common misconception that increasing the number of virtual switches used in an ESX system allows for greater performance through more physical CPU’s being utilized in parallel for driving the I/O. For example, instead of having a single virtual switch with two physical NIC’s connected to it, some customers choose to create a separate virtual switch for each physical NIC, in hopes of getting performance benefits.

In reality, network I/O processing in the vmkernel is not tied to the virtual switch in terms of the context of execution. The virtual switch is part of the larger networking stack that gets executed on packets as they travel through vmkernel.

For physical NIC receive traffic, the context of execution is tied closely to the hardware. In ESX 3.5 and earlier, the vmkernel networking stack runs from a bottom-half context armed through the receive interrupt. From ESX 4.0 onwards, the receive processing runs in the context of polling from a lightweight kernel thread, which is associated with the physical NIC.

Packets transmitted from virtual machines can be processed in a variety of contexts. The most notable is directly in the context of the transmitting entity, such as a virtual machine (VM) CPU. However to reduce the number of exits from the VM as a performance optimization transmitted packets can also be processed through opportunistic polling from other contexts such as the receive thread.

None of these contexts are tied to the number of virtual switches in the system. Instead they are associated with the traffic generating entities, such as the physical NIC’s and VM’s. Thus, there is no adverse performance effect of associating multiple physical NIC’s with a single virtual switch.

The bottom line here, of course is that the number of virtual switches does not affect network performance. In most cases one vSwitch with proper use of VLANS (VST mode) and port group override of NIC teaming policies is quite ample.