I am going to follow-up with the conference by posting a couple of #ProTips that, according to participant feedback, were the most interesting to them from my talk. Here's the list:
- Disabling Delayed TCPIP Acknowledgements for Better iSCSI Performance
- Removing Removable Devices to Conserve CPU Cycles for Better Performance
- Single-Root I/O Virtualization (SR-IOV) on Cisco UCS for Better Performance Through VM-FEX
You can also read more about my vSphere 5.5 Performance Best Practices series that I did last April/May.
Remove removable Devices for Better Performance
Disabling hardware devices (typically done in BIOS) can free interrupt resources. Additionally, some devices, such as USB controllers, operate on a polling scheme that consumes extra CPU resources. Lastly, some PCI devices reserve blocks of memory, making that memory unavailable to ESXi. — vSphere 5.5 Performance Best Practices
For example, Windows guest operating systems poll optical drives (that is, CD or DVD drives) quite frequently. When virtual machines are configured to use a physical drive, and multiple guest operating systems simultaneously try to access that drive, performance could suffer. This can be reduced by configuring the virtual machines to use ISO images instead of physical drives, and can be avoided entirely by disabling optical drives in virtual machines when the devices are not needed.
— vSphere 5.5 Performance Best Practices
- Windows polls a local CDROM drive every 10 seconds
- Windows polls a local USB drive between every 1–20 milliseconds (see this article).
And guess what? Each poll take CPU resources to perform, which means it has to be scheduled by its Virtual Machine Manager (VMM), and anything we can do to reduce CPU cycles and scheduling requests will further optimize ESXi performance.
Now for a server farm with only a few dozen VMs, this isn't usually a big issue; but at scale it is a different story. Consider the following scenario:
- 500-guest Windows 7 VDI deployment
- Each with USB access and local CDROM drive access set to autoconnect
Additionally, many of us use ISO images for our servers; how many admins forget to disconnect the CDROM image when they are finished—more than that, how many forget to deconfigure the CDROM drive from the datastore path? Yes, a VM guest still configured to an ISO path will poll, since it appears exactly the same to the Guest OS. Don't forget, it can be very easy how to know if VM has a path configured to an ISO.
- Get rid of that floppy drive. Drop it like it's hot.
- Consider changing from an ISO datastore scheme to a file server repository scheme (especially for larger deployments); then you can leave out the CDROM as well.
- If you do #2, and you still need an ISO image, you can always connect it directly through the vSphere Client.
- Carefully examine and be prepared to document your use case for A) which users actually need USB access, and B) what your connection policy will be for that (auto-connect or manual). In some instances, such as in a high-security scenario (think Edward Snowden), it is beneficial to have a "no USB devices" security policy—which actually enhances performance as well.
- Make use of tools such as VMware Flings' OS Optimization Tool. This tool can not only check for removable devices settings, but many other OS optimizations as well that can really enhance performance.