Virtual machine performance best practices and tips

Brock Bingham candid headshot
Brock Bingham|August 23, 2022
Speed up your virtual machines with these best practices
Speed up your virtual machines with these best practices

I grew up watching and loving Top Gun. The crazy stunts, the aerial acrobatics, and the blazing speed of the F-14 Tomcats had me hooked. Several decades and one sequel later, I still feel the need — the need for speed! Luckily, we at PDQ believe everything should be pretty damn quick, including our virtual machines. Here are some tips and best practices to help you get your virtual machines running at near Mach 10 speeds.

Virtual machine best practices

Getting virtual machines (VMs) configured just right can be tricky. If you assign too few resources to your VMs, they run too slowly. On the other hand, too many resources, and you’re just wasting precious hardware resources that you could assign elsewhere. Here are some best practices to help you configure your virtual environment.

Know your current and future resource requirements

Whether you’re building a new VM or purchasing all new server hardware, it’s essential to know the resource requirements of the current and potential future systems you may utilize. Most vendors, including PDQ, provide system requirements to run their platforms optimally. System requirements usually include:

  • OS versions

  • OS architecture

  • Processor requirements

  • Memory requirements

  • Disk space requirements

  • Graphical requirements

The above is a standard list of system requirements, but additional requirements, such as .NET Framework versions, Java Runtime Environment versions, network connectivity, and more, may also be included.

Most vendors divide their systems requirements into minimum and recommended. Allocating the bare minimum system requirements should usually be avoided unless you have very limited available resources.

When purchasing new hardware, consider potential future projects and systems that may be introduced into your environment. Purchase enough resources to grow into the future.

Monitor VM resource usage

Allocating the right resources to a VM is an educated guessing game at best. While system requirements are a great starting point, they don’t account for all configurations and use cases.

It’s best practice to regularly check the performance and hardware usage of your VMs, especially for newly created VMs. Monitoring performance will indicate whether you’ve allocated enough system resources, such as processing power and memory, or not.

Limit disk usage

While operating systems often require healthy amounts of disk space, most third-party systems require only a few GBs. Just because you have terabytes of storage available doesn’t mean you should be divvying it out haphazardly.

Now, I know what you’re thinking. I just told you to avoid allocating the bare minimum system resources, and for the most part, I stand by that. However, it’s easier to allocate more disk space than it is to reclaim it. For this reason alone, when building VMs, start by assigning near the minimum required disk space. Once the new VM is up and running, monitor it for a few days. If the designated drive is running out of room, simply allocate more space until the disk usage seems stable.

Purchase fast disk drives

Speaking of disk usage, one of the quickest ways to boost the performance of your VMs is to utilize fast disk drives. Solid state drives, or SSDs for short, are an obvious solution that can drastically increase your system’s performance. However, enterprise-grade storage is not cheap. While SSDs offer many benefits, such as increased speeds, lower power consumption, smaller form factors, and reduced cooling needs, they can also get expensive. If SSDs are an option for your organization, they’re highly recommended. If they are outside your budget and storage needs, consider solid state hybrid drives (SSHDs) or 10k–15k RPM traditional disk drives.

Enable load balancing

Load balancing optimizes resource utilization. When server resources are overcommitted, load balancing can live migrate VMs to servers with underutilized resources. Load balancing is great for ensuring all server resources are utilized equally.

Tips to keep your virtual infrastructure happy and healthy

Keeping your virtual environment healthy isn’t all about resource allocation and expensive equipment. Here are some quick tips to help keep your VMs and users happy.

Keep an eye out for ever-growing databases and log files

Many applications utilize databases and log files. These systems provide great functionality and are generally low maintenance but can quickly grow in size and start monopolizing your disk space. Keep an eye out for VMs that continue to require more disk space. They may have a log file or a database that needs some maintenance.

Plan for the future

I touched on this topic earlier, but I want to emphasize the importance of planning for the future when purchasing new server equipment. The last thing you want is to run out of resources shortly after you’ve installed all new equipment.

If you do need to reduce purchasing costs, then plan for scalability. Purchase equipment that can be expanded with additional drives and server bays in the future.

Delete unnecessary files before reclaiming storage

If you find yourself in a situation where you need to reclaim storage that has already been allocated, remember to manually clean up as much disk space as possible before attempting the reclaim it. Deleting temporary files, uninstalling unused applications, and limiting the size of the hibernation and pagefile are ways to reduce disk usage. However, ensure you know what you’re doing before you modify your hibernation file and pagefile. Also, consider using a disk space analyzer to identify which files take up the most space.

Don’t wait for user complaints to allocate more resources

We already covered the importance of monitoring your VMs, but monitoring is useless without action. If a VM is maxing out its assigned resources, identify the cause. If there is a rogue process or something consuming extra resources, resolve the issue. If there are no discernable issues, add the necessary resources. Remember, the best time to resolve an issue is before anyone notices and complains about it. Taking action before users complain means less time dealing with users, which is a fundamental objective of most sysadmins.

Run backups at night

VMs are great. They provide a level of flexibility and security you don’t get with traditional non-VM setups. With proper configuration, VMs can easily be backed up and, more importantly, quickly restored if things go sideways. However, when things are improperly configured, VMs can be a constant drain of administrative resources.

One configuration setting that should be obvious to most is ensuring backups are scheduled to run during nonbusiness or nonpeak hours. If your organization primarily operates from 9 a.m. to 5 p.m., schedule your backup to run at 11 p.m. If you notice that your VMs struggle during a certain period of the day, ensure an improper backup configuration isn’t the culprit.

Virtual machines are virtually everywhere

The days of one physical device being assigned one role and function are quickly fading. Virtual machines are ideal for server operations and even some desktop applications. VMs are also great for test environments because they’re quick and easy to spin up.

Speaking of quick and easy, PDQ Deploy and Inventory make managing the devices on your network fast and painless. Easily automate your patch management needs to ensure your devices stay up to date and secure. Try PDQ Deploy and Inventory for free for 14 days, and see how much time it can save you with your day-to-day administration needs.

Brock Bingham candid headshot
Brock Bingham

Born in the '80s and raised by his NES, Brock quickly fell in love with everything tech. With over 15 years of IT experience, Brock now enjoys the life of luxury as a renowned tech blogger and receiver of many Dundie Awards. In his free time, Brock enjoys adventuring with his wife, kids, and dogs, while dreaming of retirement.

Related articles