CPU utilization shown by mpstat command or sar command on guest after live migration does not correspond to actual CPU utilization

Solution Verified - Updated -

Issue

  • CPU utilization shown by mpstat command or sar command on guest after live migration does not correspond to actual CPU utilization. Although guest CPU quota is set 50%, mpstat command or sar command on guest shows 92%. mpstat command on host seems to show actual CPU utilization.
- Before live migration

   hyperA# virsh schedinfo --config rhel64
   Scheduler      : posix
   cpu_shares     : 0
   vcpu_period    : 100000
   vcpu_quota     : 50000

   hyperA#
   hyperA# virsh schedinfo --current rhel64
   Scheduler      : posix
   cpu_shares     : 0
   vcpu_period    : 100000
   vcpu_quota     : 50000

   hyperA# virsh vcpupin rhel64
   VCPU: CPU Affinity
   ----------------------------------
      0: 15


   hyperA# mpstat -P ALL 5 4
   Linux 2.6.32-358.el6.x86_64 (rhel64-sv1)         12/27/2012      _x86_64_        (16 CPU)

   03:08:43 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
   03:08:48 PM   15    0.00    0.00    0.00    0.00    0.00    0.00    0.00   50.60   49.60


   guest# mpstat -P ALL 5 4
   Linux 2.6.32-358.el6.x86_64 (rhel64)  12/27/2012      _x86_64_        (1 CPU)

   03:09:37 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
   03:09:42 PM  all   48.01    0.00    2.39    0.00    0.00    0.00   49.60    0.00    0.00
   03:09:42 PM    0   48.01    0.00    2.39    0.00    0.00    0.00   49.60    0.00    0.00


   guest# sar -u 5 4
   Linux 2.6.32-358.el6.x86_64 (rhel64)  12/27/2012      _x86_64_        (1 CPU)

   03:09:59 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
   03:10:04 PM     all     47.81      0.00      2.59      0.00     49.60      0.00
- After live migration

   hyperB# virsh schedinfo --config rhel64
   Scheduler      : posix
   cpu_shares     : 0
   vcpu_period    : 100000
   vcpu_quota     : 50000

   hyperB# virsh schedinfo --current rhel64
   Scheduler      : posix
   cpu_shares     : 1024
   vcpu_period    : 100000
   vcpu_quota     : 50000

   hyperB# virsh schedinfo --live rhel64
   Scheduler      : posix
   cpu_shares     : 1024
   vcpu_period    : 100000
   vcpu_quota     : 50000

   hyperB# virsh vcpupin rhel64
   VCPU: CPU Affinity
   ----------------------------------
      0: 15


   hyperB# mpstat -P ALL 5 4
   Linux 2.6.32-358.el6.x86_64 (rhel64-sv2)         12/27/2012      _x86_64_        (16 CPU)

   03:12:27 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
   03:12:32 PM   15    0.00    0.00    0.00    0.00    0.00    0.00    0.00   50.40   49.60


   guest# mpstat -P ALL 5 4
   Linux 2.6.32-358.el6.x86_64 (rhel64)  12/27/2012      _x86_64_        (1 CPU)

   03:13:23 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
   03:13:28 PM  all   92.22    0.00    7.78    0.00    0.00    0.00    0.00    0.00    0.00
   03:13:28 PM    0   92.22    0.00    7.78    0.00    0.00    0.00    0.00    0.00    0.00


   guest# sar -u 5 4
   Linux 2.6.32-358.el6.x86_64 (rhel64)  12/27/2012      _x86_64_        (1 CPU)

   03:13:48 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
   03:13:53 PM     all     92.09      0.00      7.91      0.00      0.00      0.00

Environment

  • Red Hat Enterprise Linux 6.3, 6.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content