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, or Google Cloud.

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.  Note that many cloud providers offer non-guaranteed or “preemptible” instance types for which steal time should be affected.  So this doesn’t necessarily mean you’re not getting what you are paying for.

If you’re experiencing a high CPU steal time, it might indicate that your VM is competing for resources with other VMs on the same physical host, which can lead to performance degradation.

It’s worth noting that a little bit of steal time isn’t a problem and is quite normal. But if you consistently see high levels, you might want to look into upgrading your VM, changing it to a non-preemptible type, or talking to your cloud service provider about the issue.

 

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:

  1. top: This command provides a dynamic real-time view of the running system. The steal time is shown under st in the %Cpu(s) row.
  2. 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 the st column.
  3. iostat: This command is used for monitoring system input/output device loading. The steal field shows the time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
  4. sar: The System Activity Reporter (sar) also can provide information on CPU steal time. You can use sar -u to see it.

Specific Commands

Here’s how you might use these tools to check CPU steal time:

  • top: Simply type top in the command line. The steal time will be shown continuously.
  • vmstat: Type vmstat 1 in the command line to see system performance stats updated every second. The steal time will be shown in the st column.
  • iostat: Type iostat -c 1 in the command line to see CPU stats updated every second. The steal time will be shown in the steal column.
  • sar: You might have to install the sysstat package to get the sar command. After that, you can type sar -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.

Call 1-828-376-0458 to Work With Linux Server Experts

Professional Linux support from senior Linux systems engineers.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.