Improving Virtual CPU Performance
This discussion goes back to the early days of virtualization and how resources are assigned. Before, people wanted to assign virtual hardware the same way they did physical hardware, which leads to inefficient use of resources. This has become less of an issue in today’s virtual data centers, but there are still some ratios that people need to be aware of. I am going to cover some of the important things to consider around the assignment and oversubscription of CPUs and help you increase the CPU performance in your VMware environment.
Improving CPU Performance in Virtual Machines: It’s All About CPUs
As a VMware admin you will need to learn about your application environment and servers when virtualizing them. This means that if they are moving from physical to virtual you should monitor their resource usage before moving to virtual. This can be done with OS level tools or there are a number of third-party tools available to help with this.
The main theme here is to accurately identify what the application’s needs will be so that you can assign an appropriate amount of resources to the virtual server. Sometimes you will be working with app owners who are bringing in a new application, and some of these vendors request some pretty large virtual resources. This may be a result of them still thinking in terms of physical servers. You will need to negotiate to a sizing level that both parties are comfortable with.
In short, it’s better for you to start at a smaller more reasonable level and work to tune the application for best performance. It will be easier for you to scale up the resources as demand can be identified versus trying to steal resources back from the application. Most newer Operating Systems can hot add resources but cannot be removed without an outage.
The last thing you want to do is keep piling on resources to the point in which things get out of control. As you can see from the image below, nothing good will come from this method.
So you may be wondering what would happen if you handed out too many vCPUs in your environment. Well, a few things: First, there would be a negative affect on VM performance and second, there would be a reduction in the amount of VMs you might be able to fit on each host. The thing that I want to point out is if you assign too many unnecessary resources, eventually they are going to overwhelm and affect performance. This might not even be a result of high demand, but rather a side effect of poor allocation. Much like the people in the bus below found out they were soon over taken by the horde.
Managing vCPU Performance
When it comes to manage vCPU performance in a VMware environment there are two primary items that you want to be monitoring and managing.
- vCPU to pCPU ration: This is the ratio of virtual CPUs to physical CPUs. Lets say I have a host with two sockets and each have four cores. This gives me eight physical CPUs in my host server. To keep my math simple, we will load on eight VMs and each will have two CPUs. This gives me a vCPU ratio of 2:1. Depending on your application workload and performance needs you can easily scale to a higher ration. But some workloads – like SQL, for example – usually require a vCPU ration in the range of 1:1 to 2:1 in order to deliver the performance required.
- CPU ready time: This is the amount of time a VM waits in a ready to run state while it waits to be scheduled on a physical CPU. It is not uncommon to see a small amount of CPU ready time on VMs, but when the value raises above 10% per vCPU, you will begin to see performance issues. This is something that should be monitored on a regular basis. You should look into it right away if there is a complaint of performance issues.
I have really only scratched the surface here on this subject. In a future post I’ll go further into in how to identify CPU ready issues.
(The images used in this article were used from the movie World War Z, which is an awesome movie that I recommend.)
More in VMware
Big Announcements at AWS re:Invent 2021
Dec 2, 2021 | Michael Otey
Amazon Announces the General Availability of VMware Cloud on AWS Outposts
Oct 12, 2021 | Michael Otey
VMworld 2020 – Announcements
Oct 5, 2020 | Michael Otey
VMware Embraces Kubernetes for App Modernization
Mar 12, 2020 | Michael Otey
VMworld 2019 Day 2 – VMware Demos Project Pacific, Tanzu Missional Control and More
Aug 28, 2019 | Michael Otey
VMware Gets Behind Kubernetes to Build-Run-Manage in the Cloud
Aug 27, 2019 | Michael Otey
Most popular on petri