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%idleintr/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:

$ mpstat11System 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

<span class="mw-page-title-main">IBM AIX</span> Series of Unix operating systems from IBM

AIX is a series of proprietary Unix operating systems developed and sold by IBM for several of its computer platforms.

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".

Processor affinity, or CPU pinning or "cache affinity", enables the binding and unbinding of a process or a thread to a central processing unit (CPU) or a range of CPUs, so that the process or thread will execute only on the designated CPU or CPUs rather than any CPU. This can be viewed as a modification of the native central queue scheduling algorithm in a symmetric multiprocessing operating system. Each item in the queue has a tag indicating its kin processor. At the time of resource allocation, each task is allocated to its kin processor in preference to others.

<span class="mw-page-title-main">Load (computing)</span> 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.

<span class="mw-page-title-main">Kernel panic</span> 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. The equivalent on Microsoft Windows operating systems is a stop error, often called a "blue screen of death".

In computing, 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) is a reference describing the conventions used for the layout of Unix-like systems. It has been made popular by its use in Linux distributions, but it is used by other Unix-like systems as well. It is maintained by the Linux Foundation. The latest version is 3.0, released on 3 June 2015.

In computing, a loadable kernel module (LKM) is an object file that contains code to extend the running kernel, or so-called base kernel, of an operating system. LKMs are typically used to add support for new hardware and/or filesystems, or for adding system calls. When the functionality provided by an LKM is no longer required, it can be unloaded in order to free memory and other resources.

In computing, the process identifier is a number used by most operating system kernels—such as those of Unix, macOS and Windows—to uniquely identify an active process. This number may be used as a parameter in various function calls, allowing processes to be manipulated, such as adjusting the process's priority or killing it altogether.

time (Unix) Command in Unix and Unix-like operating systems

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.

top (software) Task manager program found in many Unix-like operating systems

top is a task manager or system monitor program, found in many Unix-like operating systems, that displays information about CPU and memory utilization.

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.

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.

<span class="mw-page-title-main">CPU time</span> 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.

The Linux booting process involves multiple stages and is in many ways similar to the BSD and other Unix-style boot processes, from which it derives. Although the Linux booting process depends very much on the computer architecture, those architectures share similar stages and software components, including system startup, bootloader execution, loading and startup of a Linux kernel image, and execution of various startup scripts and daemons. Those are grouped into 4 steps: system startup, bootloader stage, kernel stage, and init process. When a Linux system is powered up or reset, its processor will execute a specific firmware/program for system initialization, such as Power-on self-test, invoking the reset vector to start a program at a known address in flash/ROM, then load the bootloader into RAM for later execution. In personal computer (PC), not only limited to Linux-distro PC, this firmware/program is called BIOS, which is stored in the mainboard. In embedded Linux system, this firmware/program is called boot ROM. After being loaded into RAM, bootloader will execute to load the second-stage bootloader. The second-stage bootloader will load the kernel image into memory, decompress and initialize it then pass control to this kernel image. Second-stage bootloader also performs several operation on the system such as system hardware check, mounting the root device, loading the necessary kernel modules, etc. Finally, the first user-space process starts, and other high-level system initializations are performed.

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.

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.

In computing, a status key is a keyboard key that causes an operating system and/or a program to output status information on a terminal when it is pressed. In the event that a program on a terminal produces no indications that it is running, typing the status key will reveal the program's state and activity. Older implementations produced only a quick one-line status report for the current job when the status key was pressed. Newer implementations support sending a signal to the current process to allow the application to report on status as well.

References