Mpstat

Last updated

mpstat is a computer command-line software used in Unix-type operating systems to report (on the screen) processor-related statistics. It is used in computer monitoring in order to diagnose problems or to build statistics about a computer's CPU usage.

Contents

Description

The mpstat command writes to standard output activities for each available processor.

The mpstat command can be used both on SMP and UP machines, but in the latter, only global average activities will be printed.

Usage

$ mpstat <interval> <count> 

Interval is the time in seconds between printing out a line of statistics. Count is the number of lines of output you want.

Note that the first line of output from mpstat (like iostat, vmstat, etc.) contains averages since system boot. The subsequent lines will show current values.

Examples

Different examples of output under different operating systems:

under Linux kernel 4.14 on a two CPU machine:

Linux 4.14.24.mptcp (hostname)  05/23/2018  _x86_64_ (2 CPU)03:51:19 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle03:51:20 PM  all    2.51    0.00    2.01    0.00    0.00    0.00    0.00    0.00    0.00   95.4803:51:21 PM  all    2.53    0.00    2.02    0.00    0.00    0.00    0.00    0.00    0.00   95.45

under Linux kernel 2.4:

$ mpstat Linux 2.4.21-32.ELsmp (linux00)        07/04/0710:26:54     CPU   %user   %nice %system %iowait    %irq   %soft   %idle    intr/s 10:26:54     all    0.07    0.00    0.16    8.48    0.00    0.09   91.18    165.49

under Solaris 11:

$ mpstat CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl  0    0   0    0   329  121  169    6    0    0    0   406    0   1   0  98

under AIX 6:

$ mpstat 11System configuration: lcpu=8 ent=1.0 mode=Uncappedcpu  min  maj  mpc  int   cs  ics   rq  mig lpa sysc us sy wa id   pc  %ec  lcs  0    8    0    0  182  336  102    0    0 100 1434 38 51  0 12 0.02  1.8  185  1    0    0    0   11    5    5    0    0   -    0  0 19  0 81 0.00  0.1   12  2    0    0    0    1    0    0    0    0   -    0  0 42  0 58 0.00  0.0    0  3    0    0    0    1    0    0    0    0   -    0  0 43  0 57 0.00  0.0    0  4    0    0    0    1    0    0    0    0   -    0  0 45  0 55 0.00  0.0    0  5    0    0    0    1    0    0    0    0   -    0  0 44  0 56 0.00  0.0    0  6    0    0    0    1    0    0    0    0   -    0  0  2  0 98 0.00  0.0    0  7    0    0    0   53    5    5    0    0   -    0  0 66  0 34 0.00  0.2   54  U    -    -    -    -    -    -    -    -   -    -  -  -  0 99 0.99 99.0    -ALL    8    0    0  251  346  112    0    0 100 1434  0  0  0 99 0.02  2.0  251

See also

Related Research Articles

BogoMips is a crude measurement of CPU speed made by the Linux kernel when it boots to calibrate an internal busy-loop. An often-quoted definition of the term is "the number of million times per second a processor can do absolutely nothing".

Load (computing) Amount of computational work that a computer system performs

In UNIX computing, the system load is a measure of the amount of computational work that a computer system performs. The load average represents the average system load over a period of time. It conventionally appears in the form of three numbers which represent the system load during the last one-, five-, and fifteen-minute periods.

Kernel panic Fatal error condition associated with Unix-like computer operating systems

A kernel panic is a safety measure taken by an operating system's kernel upon detecting an internal fatal error in which either it is unable to safely recover or continuing to run the system would have a higher risk of major data loss. The term is largely specific to Unix and Unix-like systems. For Microsoft Windows operating systems the equivalent term is "Stop error", resulting in a bug check screen that presents the bug check code on a blue background in Windows, or on a green background on the Xbox One platform and some Windows Insider builds.

In computer, scheduling is the action of assigning resources to perform tasks. The resources may be processors, network links or expansion cards. The tasks may be threads, processes or data flows.

Uptime is a measure of system reliability, expressed as the percentage of time a machine, typically a computer, has been working and available. Uptime is the opposite of downtime.

The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Linux distributions. It is maintained by the Linux Foundation. The latest version is 3.0, released on 3 June 2015.

In computing, time is a command in Unix and Unix-like operating systems. It is used to determine the duration of execution of a particular command.

/dev/random Pseudorandom number generator file in Unix-like operating systems

In Unix-like operating systems, /dev/random, /dev/urandom and /dev/arandom are special files that serve as pseudorandom number generators. They allow access to environmental noise collected from device drivers and other sources. /dev/random typically blocked if there was less entropy available than requested; more recently it usually blocks at startup until sufficient entropy has been gathered, then unblocks permanently. The /dev/urandom device typically was never a blocking device, even if the pseudorandom number generator seed was not fully initialized with entropy since boot. /dev/arandom blocks after boot until the seed has been securely initialized with enough entropy, and then never blocks again. Not all operating systems implement the same methods for /dev/random and /dev/urandom and only a few provide /dev/arandom.

The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. Typically, it is mapped to a mount point named /proc at boot time. The proc file system acts as an interface to internal data structures about running processes in the kernel. In Linux, it can also be used to obtain information about the kernel and to change certain kernel parameters at runtime (sysctl).

The magic SysRq key is a key combination understood by the Linux kernel, which allows the user to perform various low-level commands regardless of the system's state. It is often used to recover from freezes, or to reboot a computer without corrupting the filesystem. Its effect is similar to the computer's hardware reset button but with many more options and much more control.

The High Precision Event Timer (HPET) is a hardware timer used in personal computers. It was developed jointly by Intel and Microsoft and has been incorporated in PC chipsets since 2005. Formerly referred to by Intel as a Multimedia Timer, the term HPET was selected to avoid confusion with the software multimedia timers introduced in the MultiMedia Extensions to Windows 3.0.

vmstat is a computer system monitoring tool that collects and displays summary information about operating system memory, processes, interrupts, paging and block I/O. Users of vmstat can specify a sampling interval which permits observing system activity in near-real time.

lspci is a command on Unix-like operating systems that prints ("lists") detailed information about all PCI buses and devices in the system. It is based on a common portable library libpci which offers access to the PCI configuration space on a variety of operating systems.

CPU time Time used by a computer

CPU time is the amount of time for which a central processing unit (CPU) was used for processing instructions of a computer program or operating system, as opposed to elapsed time, which includes for example, waiting for input/output (I/O) operations or entering low-power (idle) mode. The CPU time is measured in clock ticks or seconds. Often, it is useful to measure CPU time as a percentage of the CPU's capacity, which is called the CPU usage. CPU time and CPU usage have two main uses.

A system file in computers is a critical computer file without which a computer system may not operate correctly. These files may come as part of the operating system, a third-party device driver or other sources. Microsoft Windows and MS-DOS mark their more valuable system files with a "system" attribute to protect them against accidental deletion.

Linux startup process is the multi-stage initialization process performed during booting a Linux installation. It is in many ways similar to the BSD and other Unix-style boot processes, from which it derives.

In the x86 computer architecture, HLT (halt) is an assembly language instruction which halts the central processing unit (CPU) until the next external interrupt is fired. Interrupts are signals sent by hardware devices to the CPU alerting it that an event occurred to which it should react. For example, hardware timers send interrupts to the CPU at regular intervals.

In multiprocessor computer systems, software lockout is the issue of performance degradation due to the idle wait times spent by the CPUs in kernel-level critical sections. Software lockout is the major cause of scalability degradation in a multiprocessor system, posing a limit on the maximum useful number of processors. To mitigate the phenomenon, the kernel must be designed to have its critical sections as short as possible, therefore decomposing each data structure in smaller substructures.

nmon System monitor tool for the AIX and Linux operating systems

nmon is a computer performance system monitor tool for the AIX and Linux operating systems. The nmon tool has two modes a) displays the performance stats on-screen in a condensed format or b) the same stats are saved to a comma-separated values (CSV) data file for later graphing and analysis to aid the understanding of computer resource use, tuning options and bottlenecks.

sar (Unix)

System Activity Report (sar) is a Unix System V-derived system monitor command used to report on various system loads, including CPU activity, memory/paging, interrupts, device load, network and swap space utilization. Sar uses /proc filesystem for gathering information.

References