Because of the enormous consolidation ratios modern RAM/CPU densities offer, the strategy is to eke out as much performance as possible from every VM. Even very small performance gains can add up when they are multiplied by the number of VMs running in an environment, since VM performance ultimately hinges on the available resources. We will take a quick look at some ideas to consider after the break.
Size VMs appropriately
One of the largest causes of virtual headaches, rightsizing VMs is no small task. Undersize a machine, and your applications will be starved of resources and run poorly. Oversize machines, and your whole environment can be affected. Too-big VMs are much more common, and can cause performance problems such as co-stop as the environment gets closer to an oversubscribed state. It is best to make every effort to keep your VMs as small as possible.
One thing that people often don’t consider is that as you add CPUs, the overhead required to schedule and manage goes up exponentially. Your environment is, in effect, being hit twice by the expanded CPU count. This problem has been lessened in newer versions of ESXi, but it is still not zero.
Remove unused/unneeded devices
A virtual machine is created with a number of devices that impede performance and take up OS resources. Devices such as CDROM and Floppy drives, COM and LPT ports should be removed unless they are needed. Templates that are used in an environment should have these removed, saving an administrator the effort of getting rid of them later.
There are many ways to optimize an OS to run in a virtual environment. Things like disabling X in Linux, or running Windows 2012 in core mode obviously help, but are dependent on environment and may not be practical as global best-practices. However, things like disabling screen-savers, power controls, and enabling max performance mode are going to help universally.
People running in a virtual desktop environment may be familiar with the VMware View Optimization Guide, which contains many VM performance best practices as well as Windows operating system tweaks. The entire document is worth reading even if you are not a VDI administrator.
Keep snapshots under control
As long as a snapshot is present it is having an effect on performance. This is invisible for the most part, but if snapshots get large, the VM will begin to have an I/O lag that is measurable. This is because the reads and writes to the VM have to interact to a delta file and the underlying disk. The snapshot process also creates additional overhead as the ESXi host works to keep track of the snapshot. Start creating a lot of snapshots, and forgetting about them, and you’re going to have a problem. This is why VMware’s best practice for snapshots has long been a max age of 72 hours.
While there are many ways to look at snapshot behavior from 3rd party tools, there is actually a pre-built alarm within vSphere that can be leveraged. It is based on snapshot size rather than age, but enabling it and setting it at a reasonable size (2-4GB is a good starting point) will at least generate alerts that will be visible in the client.