La commande 'mpstat' permet de visualiser les statistiques des processeurs logiques de la partition AIX courante.

La commande peut être lancée avec ou sans argument.

Une autre utilisation de 'mpstat' permet de visualiser de façon dynamique l'activité des processeurs logiques durant une période donnée, à intervalle fixe.

Des exemples de sortie écran sont donnés ci-dessous.

# mpstat

System configuration: lcpu=2 ent=0.5 mode=Uncapped

cpu  min  maj  mpc  int   cs  ics   rq  mig lpa sysc us sy wt id   pc  %ec  lcs
0 74981223 810483 3744 443646132 880962189 288571075    7 5211001 100 9354293123 70 27  0  2 0.00  1.0 315529343
1 41894945 176080 3744 50309085 65400222 25378809    0 5254913 100 904967617 33 12  1 55 0.00  0.2 319590771
U    -    -    -    -    -    -    -    -   -    -  -  -  5 94 0.49 98.8    -
ALL 116876168 986563 7488 493955217 946362411 313949884    7 10465914 100 10259260740  1  0  5 94 0.01  1.2 635120114
vcadinet1:/# mpstat -a

System configuration: lcpu=2 ent=0.5 mode=Uncapped

cpu    min    maj   mpcs   mpcr    dev   soft    dec     ph     cs    ics  bound     rq   push S3pull  S3grd  S0rd  S1rd  S2rd  S3rd  S4rd  S5rd   sysc    us    sy    wt    id    pc   %ec   ilcs   vlcs
0 74981356 810484   2858    886 13273683 43989491 384849037 1538904 880972566 288574415      1      4      0      0      0  99.4   0.6   0.0   0.0   0.0   0.0 9354406737  70.2  26.8   0.5   2.5  0.00   1.0 1686633 313846099
1 41894945 176080    886   2858 13207567  53856 36457215 590728 65400493 25378924      0      0      0      0      0  91.5   8.5   0.0   0.0   0.0   0.0 904973091  32.6  11.5   1.0  54.9  0.00   0.2 516000 319078181
U      -      -      -      -      -      -      -      -      -      -      -      -      -      -      -     -     -     -     -     -     -      -     -     -   5.3  93.5  0.49  98.8      -      -
ALL 116876301 986564   3744   3744 26481250 44043347 421306252 2129632 946373059 313953339      1      4      0      0      0  98.9   1.1   0.0   0.0   0.0   0.0 10259379828   0.8   0.3   5.3  93.7  0.01   1.2 2202633 632924280
vcadinet1:/# mpstat 2 6

System configuration: lcpu=2 ent=0.5 mode=Uncapped

cpu  min  maj  mpc  int   cs  ics   rq  mig lpa sysc us sy wt id   pc  %ec  lcs
0    0    0    0  718 1529  460    1   15 100 17043 74 24  0  2 0.15 29.6  491
1    0    0    0   39   62   32    0    5 100 1139 23  8  3 66 0.02  4.6  484
U    -    -    -    -    -    -    -    -   -    -  -  -  2 63 0.33 65.7    -
ALL    0    0    0  757 1591  492    1   20 100 18182 23  7  3 67 0.17 34.3  975
--------------------------------------------------------------------------------
0  952    2    0  721 1553  446    1   34 100 17260 75 22  0  2 0.17 34.7  477
1  208    1    0   61  216   71    0   32 100 2267 44  9  4 43 0.05  9.1  491
U    -    -    -    -    -    -    -    -   -    -  -  -  4 52 0.28 56.2    -
ALL 1160    3    0  782 1769  517    1   66 100 19527 30  8  4 57 0.22 43.8  968
--------------------------------------------------------------------------------
0    0    0    0  733 1351  419    1    0 100 16267 73 25  0  2 0.14 27.7  458
1    0    0    0   28    0    0    0    0   -    0  0  2  0 98 0.02  3.3  460
U    -    -    -    -    -    -    -    -   -    -  -  -  2 67 0.35 69.0    -
ALL    0    0    0  761 1351  419    1    0 100 16267 20  7  2 71 0.15 31.0  918
--------------------------------------------------------------------------------
0    5    0    0  713 1330  427    0   10 100 14787 71 25  0  3 0.13 25.3  505
1    0    0    0   93  188   36    0   15 100 1572 44 10  0 47 0.03  6.2  509
U    -    -    -    -    -    -    -    -   -    -  -  -  3 66 0.34 68.8    -
ALL    5    0    0  806 1518  463    0   25 100 16359 21  7  3 70 0.16 31.5 1014
--------------------------------------------------------------------------------
0    7    0    0  742 1562  475    0   29 100 15575 75 22  0  2 0.17 33.1  570
1    0    0    0  127  112   57    0   23 100 2042 32 13  2 54 0.03  6.5  604
U    -    -    -    -    -    -    -    -   -    -  -  -  5 55 0.30 60.4    -
ALL    7    0    0  869 1674  532    0   52 100 17617 27  8  6 59 0.20 39.6 1174
--------------------------------------------------------------------------------
0   10    0    0  735 1406  438    0    2 100 16690 72 26  0  2 0.14 28.4  463
1    0    0    0   30   10    5    0    2 100  232  7  3  0 90 0.02  3.6  464
U    -    -    -    -    -    -    -    -   -    -  -  -  2 66 0.34 68.0    -
ALL   10    0    0  765 1416  443    0    4 100 16922 21  8  2 70 0.16 32.1  927

# mpstat -s 2 2

System configuration: lcpu=20 ent=2.0 mode=Uncapped

             Proc0                           Proc4                           Proc8
              0.27%                           0.26%                           0.19%
 cpu0    cpu1    cpu2    cpu3    cpu4    cpu5    cpu6    cpu7    cpu8    cpu9    cpu10   cpu11
  0.11%   0.05%   0.05%   0.05%   0.14%   0.04%   0.04%   0.04%   0.07%   0.04%   0.04%   0.04%

            Proc12                          Proc16
              0.12%                           3.30%
 cpu12   cpu13   cpu14   cpu15   cpu16   cpu17   cpu18   cpu19
  0.04%   0.03%   0.03%   0.03%   2.06%   0.42%   0.41%   0.41%
--------------------------------------------------------------------------------
             Proc0                           Proc4                           Proc8
              0.29%                           2.53%                           0.24%
 cpu0    cpu1    cpu2    cpu3    cpu4    cpu5    cpu6    cpu7    cpu8    cpu9    cpu10   cpu11
  0.12%   0.06%   0.06%   0.06%   1.62%   0.31%   0.31%   0.31%   0.10%   0.05%   0.05%   0.05%


La documentation officielle de la commande est donnée ci-dessous.

Commands Reference, Volume 3, i - m

mpstat Command

Purpose

Collects and displays performance statistics for all logical CPUs in the system.

Syntax

mpstat [ { -d | -i | -s | -a | -h} ] [ -w ] [ interval [ count ] ]

Description

The mpstat command collects and displays performance statistics for all logical CPUs in the system. Users can define
both, the number of times the statistics are displayed, and the interval at which the data is updated. When the
mpstat command is invoked, it displays two sections of statistics. The first section displays the System
Configuration, which is displayed when the command starts and whenever there is a change in the system
configuration. The second section displays the Utilization Statistics which will be displayed in intervals and at
any time the values of these metrics are deltas from pervious interval.

The following information is displayed in the system configuration section:
lcpu
Number of online logical processors.
ent
Entitled processing capacity in processor units. This information will be displayed only if the partition type
is shared.
mode
Indicates whether the partition processor capacity is capped or uncapped allowing it to consume idle cycles
from the shared pool. Dedicated LPAR is capped or donating.

The performance statistics displayed by mpstat are detailed below:
CPU
(All flags) The logical CPU ID.
min
(Default, -a flag) The minor page faults (page faults with no IO).
maj
(Default, -a flag) The major page faults (page faults with disk IO).
mpcs
(-a, -i flag) The number of mpc send interrupts.
mpcr
(-a, -i flag) The number of mpc receive interrupts.
mpc
(Only default) The total number of inter-processor calls .
dev
(-a, -i flag) The number of device interrupts.
soft
(-a, -i flag) The number of software interrupts.
dec
(-a, -i flag) The number of decrementer interrupts.
ph
(-a, -i flag) The number of phantom interrupts.
int
(Only default) The total number of interrupts.
cs
(Default, -a flag) The total number of context switches.
ics
(Default, -a flag) The total number of involuntary context switches.

bound
(-a, -d flag) The total number of threads that are bound.
rq
(Default, -a, -d flag) The run queue size.
push
(-a, -d flag) The number of migrations due to starvation load balancing .
S3pull
(-a, -d flag) The number of migrations outside the scheduling affinity domain 3 due to idle stealing.
S3grd
(-a, -d flag) The number of dispatches from global runqueue, outside the scheduling affinity domain 3.
mig
(Only default) The total number of thread migrations (to another logical processor).
S0rd
(-a, -d flag) The percentage of thread redispatches within the scheduling affinity domain 0.
S1rd
(-a, -d flag) The percentage of thread redispatches within the scheduling affinity domain 1.
S2rd
(-a, -d flag) The percentage of thread redispatches within the scheduling affinity domain 2.
S3rd
(-a, -d flag) The percentage of thread redispatches within the scheduling affinity domain 3.
S4rd
(-a, -d flag) The percentage of thread redispatches within the scheduling affinity domain 4.
S5rd
(-a, -d flag) The percentage of thread redispatches within the scheduling affinity domain 5.
lpa
(Only default) The logical processor affinity. The percentage of logical processor redispatches within the
scheduling affinity domain 3.
sysc
(Default, -a flag) The number of system calls.
us
(Default, -a flag) The percentage of physical processor utilization that occurred while executing at the user
level (application).
sy
(Default, -a flag) The percentage of physical processor utilization that occurred while executing at the system
level (kernel).
wa
(Default, -a flag) The percentage of time that the logical processor was idle during which it had an
outstanding disk I/O request.
id
(Default, -a flag) The percentage of time that the logical processor was idle and it did not have an
outstanding disk I/O request.
pc
(Default, -a flag, -h flag) The fraction of physical processor consumed. It is displayed in both shared
partition and dedicated partition. For the default flag in the dedicated partition, it is not displayed when
both donation and simultaneous multithreading are disabled.

The pc of the cpuid U row represents the number of unused physical processors.
%ec
(Default, -a flag) The percentage of entitled capacity consumed by the logical CPU. The %ec of the ALL CPU row
represents the percentage of entitled capacity consumed. Because the time base over which this data is computed
can vary, the entitled capacity percentage can sometimes exceed 100%. This excess is noticeable only with small
sampling intervals. The attribute is displayed only in a shared partition.
ilcs
(-a, -d, -h flag) The number of involuntary logical CPU context switches, displayed only in shared partition.
For the -h and -a flags, it is also displayed in dedicated partition.
vlcs
(-a, -d, -h flag) The number of voluntary logical CPU context switches. Displayed only in shared partition. For
the -h and -a flags, it is also displayed in dedicated partition.

lcs
(Default) The total number of logical CPU context switches. Displayed only in shared partition or when
dedicated partition is donating.
%idon
(-a, -h flag) The percentage of physical processor utilization that occurs while explicitly donating idle
cycles. Displayed only in dedicated partition that is donating.
%bdon
(-a, -h flag) The percentage of physical processor utilization that occurs while donating busy cycles.
Displayed only in dedicated partition that is donating.
%istol
(-a, -h flag) The percentage of physical processor utilization that occurs while the Hypervisor is stealing
idle cycles. Displayed only in dedicated partition.
%bstol
(-a, -h flag) The percentage of physical processor utilization that occurs while the Hypervisor is stealing
busy cycles. Displayed only in dedicated partition.
%nsp
(-a, -d flag) The current average processor speed as a percentage of nominal speed. Displayed only if the
hardware uses the SPURR.

The mpstat command displays all the above statistics for every logical CPU in the partition. When running a shared
partition, a special CPU row with the cpuid U can be displayed when the entitled processing capacity has not
entirely been consumed.

The mpstat command also displays a special CPU row with the cpuid ALL which shows the partition-wide utilization. On
that row, except for uncapped partitions with current physical processor consumption above their entitled capacity,
the percentages are relative to the entitled processing capacity. For dedicated partitions, the entitled processing
capacity is the number of physical processors.

When the -s flag is specified, the mpstat command reports simultaneous multi-threading utilization, if it is
enabled. This report displays the Virtual CPU Engines Utilization and utilization of each thread ( logical CPU )
associated with the Virtual CPU engine.

If mpstat is running in a dedicated partition and simultaneous multi-threading is enabled, then only the thread
(logical CPU) utilization is displayed.

Flags
-a
Displays all the statistics.
-d
Displays detailed affinity and migration statistics for AIX threads and dispatching statistics for logical
processors.
-i
Displays detailed interrupts statistics.
-s
Display simultaneous multi-threading threads utilization, this flag is available only when mpstat runs in a
simultaneous multi-threading enabled partition.
-h
Displays pc and CPU switches, with stolen and donation statistics for dedicated partitions.
-w
Displays wide column output, switches to wide output mode. Default is 80 column output mode.  Note: The -a, -d,
and -i flags implicitly turn on wide-column output.

Parameters
interval
Specifies the interval between the iterations. If interval is not specified, just one snapshot of metrics will
be displayed which actually reports the values from the time system is up. If interval is specified, the tool
will wait for that duration before printing the first set of data. Each set of data will be followed by a
separation line, a line with average values for each columns (except the CPU, which will be replace by ALL),
followed by an empty line.

count
Specifies number of iterations. If interval is specified and count is not specified then mpstat will run
infinitely. count can not be specified without specifying interval.

Examples
1    To see the default set of utilization metrics, type:

mpstat 1 1
2    To see the default set of utilization metrics in wide display mode, type:

mpstat -w 1 1
3    To see the detailed dispatch & affinity metrics, type:

mpstat -d 1 1
4    To see the detailed interrupts report, type:

mpstat -i 1 1
5    To see all the statistics, type:

mpstat -a 1 1
6    To see simultaneous multi-threading utilization, type:

mpstat -s 1 1

Files
/usr/bin/mpstat
Contains the mpstat command.

Related Information

The lparstat command, iostat command, vmstat command, and the sar command.

icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone