Virtual machines (VMs) report on different types of usage metrics, such as server load, memory usage, and steal time. And people often ask about steal time – what is it, and why is it reported on their virtual machines? In this article we will explain steal time to better understand what it means for your virtual machine.
The definition of CPU Steal Time is “The percentage of time a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor.”
In a cloud environment, the hypervisor is the interface between the physical server and the virtualized environment. The hypervisor kernel manages all tasks by scheduling the processes to the physical cores of the server. Processes such as virtual machines, networking operations and storage I/O requests are given CPU time to process jobs. CPU time is allocated between these processes.
Your virtual machine (VM) shares resources with other instances on a single host in a virtualized environment. One of the resources it shares is CPU Cycles. It is often not the case of not receiving the CPU time you should be getting, in fact in many cases you can often soak up spare CPU cycles beyond your allocated size. You won’t see any CPU steal time in those cases however.
In a modern hosting environment, a small amount of steal time is unavoidable, especially with shared cloud hosting. However, the steal time virtual machines experience is not always visible from outside the virtualized operating system.
You can monitor processes and resource usage using the top command on your Linux server. The output shows a whole host of metrics and steal time is labeled as ‘st’.
Steal time can also be monitored with the iostat, vmstat, sar commands.
On virtual machines steal time is visible along with idle time. Idle time shows there is CPU time allocated by the hypervisor, but the virtual machine is not using that time. In such cases it is clear any steal time does not affect the performance.
When the idle time percentage is 0 and the value of steal time shows a higher level over a longer period of time, it is safe to assume processes on the virtual machine are processed with some delay.
Since CPU steal time in the cloud is a bit more complex than in a traditional dedicated physical environment. Since reporting tools in the operating systems have not been adjusted for use in a VPS, on a shared environment or on a virtual machine, reports of CPU steal time can be a false positive. When you see CPU steal time it does usually mean the processes do run into some sort of resource constraint. The three most common situations are described in more detail below.
If you see a constant steal time on your virtual machine, do you notice any loss in performance on your applications? If this is the case, try to find out if your application is causing this. Keep us informed if you suspect the root cause is outside of your environment. In those situations, we can generally solve the problems quickly by moving your virtual machine to a different hypervisor. We would normally see high loads on our systems long before you do, and we would automatically adjust our systems to handle such peaks.
If the problem is some process eating away on resources at your end, you can try increasing the CPU resources % of your VPS. This will be a temporary fix however if the root cause is some slow and inefficient code within your application.
If you know you will be running heavy processes on your VPS for a few hours, you can increase the CPU resources temporarily via the configurator in my.tilaa. And when you're done, you can revert back to your original settings.
However, if all the hosts within the POD your VPS is on are full (and we monitor those metrics on our end, so 9 times out of 10 we have received alerts from our monitoring systems, warning us about extremely high activity on the hypervisors, and we have already taken care of the issues at hand) we can migrate your server to a different POD.
You can always contact our support and open a ticket if you find suspect metrics for steal time or if you are experiencing performance problems with your VPS through my.tilaa and we'll investigate the issue.