What is CPU Steal Time?
In Linux, CPU steal time refers to the amount of time a virtual CPU waits for a real CPU while the hypervisor is servicing another virtual processor. This measurement is often seen in virtualized environments like AWS, Azure, Google Cloud or any other hosting platform.
In simpler terms, ‘steal time’ is time that a virtual CPU is ready to execute, but it couldn’t because the underlying physical CPU was busy with other tasks.
In more direct terms, this is a measurement of how oversold your hosting provider is, and how much CPU you need that you’re not getting. This doesn’t necessarily mean you’re not getting what you are paying for.
It’s worth noting that a small amount of steal time is normal and not a cause for concern. However, if you consistently observe high levels, please open a ticket and inform us of the situation. This should not occur on our infrastructure and might be the result of some type of misconfiguration.
How to measure CPU Steal Time under Linux
In Linux, you can measure CPU steal time using a variety of command line tools. Here are some of the most common ones:
top: This command provides a dynamic real-time view of the running system. The steal time is shown understin the%Cpu(s)row.vmstat: This command reports information about processes, memory, paging, block IO, traps, disks and cpu activity. You can use it to monitor the steal time with thestcolumn.iostat: This command is used for monitoring system input/output device loading. Thestealfield shows the time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.sar: The System Activity Reporter (sar) also can provide information on CPU steal time. You can usesar -uto see it.
Specific Commands
Here’s how you might use these tools to check CPU steal time:
top: Simply typetopin the command line. The steal time will be shown continuously.vmstat: Typevmstat 1in the command line to see system performance stats updated every second. The steal time will be shown in thestcolumn.iostat: Typeiostat -c 1in the command line to see CPU stats updated every second. The steal time will be shown in thestealcolumn.sar: You might have to install thesysstatpackage to get thesarcommand. After that, you can typesar -u 1in the command line to see CPU stats updated every second. The steal time will be shown in the%stealcolumn.
Remember to replace 1 with whatever update frequency you prefer.
Version: 1
Date: 02-12-2024
