Manage Learn to apply best practices and optimize your operations.

Optimize performance of Linux VMs on VMware with these best practices

There are a number of ways to improve Linux VM performance on VMware, including making adjustments to your virtual hardware and changing default software configuration settings.

Although it's easy to install Linux VMs on a VMware hypervisor, the default, out-of-the-box configuration doesn't...

capitalize on the VM's potential maximum performance. However, there are ways to optimize Linux VMs on VMware.

Virtual hardware

First, consider your virtual hardware. Each new version of a VMware product also brings new virtual hardware versions. Use the most recent hardware version whenever possible because, as with most OSes, patches and performance improvements are added incrementally. Your paravirtualized hardware sits next to your virtual hardware.

Paravirtualized hardware

Paravirtualized hardware is essentially a software implementation of a piece of hardware. For example, the network controller VMXNET3 is fully paravirtualized and talks directly to the hardware to provide better performance, bypassing layers of virtualization and reducing performance drag. You can also paravirtualize SCSI controllers.

Customize VMware virtual hardware
Customize the virtual hardware to your specifications.

Paravirtualized hardware provides significant performance enhancements, so if it's available, take it. On that note, however, some older Linux platforms don't support paravirtualized hardware. Your mileage might vary.

Unused hardware

One thing administrators tend to forget about is unused hardware. By default, Linux VMs come with hardware that you might never use, such as floppy drives, CD-ROMs and sound cards.

Most large environments automatically remove floppy drives. Admittedly, it won't free up massive amounts of RAM in smaller estates, but in medium-sized estates, this can save a reasonable amount of memory resources.

You should also remove this extraneous hardware as part of a physical-to-virtual cleanup. VMs that have been cleaned up and right-sized tend to perform better.

Default settings

When you build a VM, don't use the VMware default settings, as these are very conservative. I recommend looking at vendor documentation for sensible default settings. Even better, develop a service offering with small, medium and large options so that it provides consistency for everyone involved. Then, choose the correct size. This is especially important when it comes to disk size because it can be difficult to expand boot volumes.

Installing a GUI

There are other components you can adjust to improve performance, and some Linux vendors do this better than others. The most important item to consider is run level. RedHat and CentOS install the GUI by default. I recommend you avoid installing the GUI unless it's absolutely necessary. If you don't install the GUI, you'll use less CPU and RAM and have fewer applications to manage. This can save a significant amount of resources across the state. However, some servers might require a GUI for a specific application. If your Linux VMs already have the GUI installed, it's possible to turn off the GUI-using system. Use the following command to set the system to boot to the networked command line:

systemctl set-default multi.user

If the administrator can't live without the GUI, repeat the process, and use the command shown below:

Systemctl set-default

It's also possible to start the GUI on an as-needed basis by typing init 5. This loads the GUI for the duration of that session.

Open-VM-Tools vs. VMware Tools

If you do install VMware Tools over OVT, the OS vendor might consider an unsupported configuration.

Traditionally, one of the first things an administrator had to do to improve performance was install VMware Tools, but recently, most vendors have switched to Open-VM-Tools (OVT), an open source version of VMware Tools.

Most Linux vendors, including Red Hat and Canonical, ship OVT as part of the default Linux installation. If OVT is installed, make sure it isn't overwritten by VMware Tools. If you do install VMware Tools over OVT, the OS vendor might consider an unsupported configuration.

System time

Administrators often overlook system time. By default, the time is picked up from the hypervisor. System time best practices have changed over the years, but the current best practice is to make sure that the Linux VMs and hosts are all synchronized directly to a Network Time Protocol (NTP) host on the network. If all of your networked devices use the same NTP server, all of your servers will be in sync. Correct system time is critical to running an effective network.

Memory management

Linux VMs that run Java have a known memory management issue, one that can severely affect performance. Based on the way the VMware balloon driver in the guest Java allocates and reclaims memory, performance will be suboptimal.

The VMware Tools or OVT driver tries to reclaim unused memory, but Java expects to use the memory it was originally allocated. To avoid this issue, allocate the VM's memory up front. This might go against the conventional wisdom of letting VMware manage the memory allocated to the VM, but it's necessary to achieve optimal Java VM performance.

Disk configuration

Finally, look at disk configuration. Disk expansion is easy to manage in a virtual environment, but the best practice is to separate system disks from data disks.

Any administrator who doesn't use logical volume management (LVM) or something similar misses a very valuable function of the virtual environment.

LVM acts as a layer of glue over any virtual disks, which allows the administrator to add or manage disks underneath the OS and still present the additional disk as one contiguous space. This eliminates the need to mess around with the partition to get more space. The administrator can thin provision these underlying disks so that space isn't allocated until it's needed. LVM has other built-in functions, such as disk snapshotting, but should be used with caution.

Also, if you don't use CD-ROMs or other virtual removable media, make sure to disconnect them. If virtual CDs remain connected, they prevent vMotion of Linux VMs to other hosts, and because the VMs can't be moved, they can even affect the DRS.

Next Steps

Review alternate Linux I/O schedulers

Reap the benefits of Linux Integration Services 4.1

Upload Linux to multiple internet of things devices

This was last published in July 2017

Dig Deeper on Virtual machine performance management



Find more PRO+ content and other member only offers, here.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What are some other best practices for improving performance of Linux on VMware?