Editing
Linux commands
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Using mpstat command to obtain CPU usage ==== Example result of {{kbd | key=<nowiki>mpstat 2 2 | grep -E '^Average'</nowiki>}} on {{Linux}} <pre> Average: all 1.31 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 98.43 </pre> The output of the mpstat command includes an "Average" line, which provides detailed information about CPU usage, similar to the %Cpu(s) line in the top command but with a slightly different format. Here's an explanation of the columns in the "Average" line: * all: This represents the average values for all CPU cores. The subsequent columns represent percentages of CPU usage: * The first column (1.31) is the CPU usage by user-space processes, indicating the percentage of time the CPU is occupied by user programs and processes. * The second column (0.00) is the CPU usage by system kernel processes, indicating the percentage of time the CPU is occupied by the operating system kernel. * The third column (0.25) is the CPU usage by processes with a "nice" priority, representing the percentage of CPU time used by processes adjusted with the nice command. * The fourth column (0.00) is the CPU's idle time, indicating the percentage of time the CPU is not executing any tasks. * The fifth column (0.00) is the CPU's time spent waiting for I/O operations to complete, indicating the percentage of time the CPU is waiting for disk or other I/O device responses. * Columns six through eleven (0.00 to 0.00) represent CPU usage in other states, such as the time spent handling hardware or software interrupts and time spent in virtualized environments with CPU steal time. * The last column (98.43) indicates the percentage of time the CPU is idle, representing the time when the CPU is not executing any tasks. In the above example, the CPU usage is as follows: * User processes have used 1.31% of CPU time. * System kernel processes have used 0.00% of CPU time. * There are no "nice" priority processes using CPU time. * The CPU is idle for 98.43% of the time. * There is no time spent waiting for I/O operations to complete. * There is no time spent handling hardware or software interrupts. * There is no CPU steal time in a virtualized environment.
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information