Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command mpsta

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the usage of Linux basic command mpsta", in daily operation, I believe many people have doubts about the usage of Linux basic command mpsta, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, hope to answer "Linux basic command mpsta usage" doubts helpful! Next, please follow the small series to learn together!

mpstat

The mpstat command is used to display cpu usage and display the contents to standard output. Processor 0 is the first. Global average activity across all processors is also reported. The mpstat command can be used on both SMP and UP machines, but in the latter case only the global average activity is printed. If no activity is selected, the default report is the CPU utilization report.

The Interval parameter specifies the amount of time in seconds between each report. A value of 0(or no parameters at all) indicates that processor statistics will be reported since system startup (boot). If the count parameter is not set to zero, you can specify the Count parameter with the Interval parameter. The count value determines the number of reports generated every second. If the Interval parameter is not specified with the count parameter, the mpstat command generates reports continuously.

Scope of this command: Red Hat, RHEL, Ubuntu, CentOS, Fedora, SUSE, openSUSE.

1. Grammar

mpstat [ -A ] [ -I { SUM | CPU | ALL } ] [ -u ] [ -P { cpu [,...] | ON | ALL} ] [ -V ] [ interval [ count ] ]

2. Option list

option

description

-A

Equivalent to "-I ALL -u -P ALL"

-I {SUM | CPU | ALL}

Display interrupt information: SUM, showing the number of interrupts per CPU;CPU, showing the number of interrupts received per second;ALL, equivalent to having both SUM and CPU attributes

-P {cpu […] | ON |ALL}

Specifies the CPU number, starting with 0. ON stands for, each line displays one CPU message. ALL stands for displaying all CPU information

-u

Show CPU usage status:

-V

Display version information and launch

3. CPU status

"-u" option can display cpu status

option

description

CPU

Processor number. The keyword ALL indicates that statistics are calculated as averages across all processors.

%usr

Displays the percentage of CPU utilization that occurs when executing at the user level (application).

%nice

Displays the percentage of CPU utilization when executed at user level with good priority.

%sys

Displays the percentage of CPU utilization at system level (kernel) execution. Note that this does not include time spent servicing hardware and software outages.

%iowait

Displays the CPU or percentage of time the CPU is idle during which the system has outstanding disk I/O requests.

%irq

Displays the percentage of time the cpu or cpu spends servicing hardware outages.

%soft

Displays the CPU or the percentage of time the CPU spends servicing software interrupts.

%steal

Displays the percentage of time a virtual CPU or CPU spends involuntarily waiting when the hypervisor is servicing another virtual processor.

%guest

Displays the percentage of time the CPU or CPU spends running virtual processors.

%idle

Displays the CPU or percentage of time the CPU is idle and the system has no outstanding disk I/O requests.

4. Examples

Show CPU usage

[root@localhost ntop-4.0.1]# mpstat -u

Linux 2.6.32-431.el6.i686 (localhost.localdomain) October 10, 2018_i686_ (1 CPU)

15:59:39 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle

15:59:39 all 0.17 0.00 0.09 0.04 0.01 0.00 0.00 99.69

At this point, on the "Linux basic command mpsta usage" learning is over, I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report