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 underst
in 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 thest
column.iostat
: This command is used for monitoring system input/output device loading. Thesteal
field 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 -u
to see it.
Specific Commands
Here’s how you might use these tools to check CPU steal time:
top
: Simply typetop
in the command line. The steal time will be shown continuously.vmstat
: Typevmstat 1
in the command line to see system performance stats updated every second. The steal time will be shown in thest
column.iostat
: Typeiostat -c 1
in the command line to see CPU stats updated every second. The steal time will be shown in thesteal
column.sar
: You might have to install thesysstat
package to get thesar
command. After that, you can typesar -u 1
in the command line to see CPU stats updated every second. The steal time will be shown in the%steal
column.
Remember to replace 1
with whatever update frequency you prefer.
Version: 1
Date: 02-12-2024