【发布时间】:2017-10-03 10:37:17
【问题描述】:
我真的很困惑。为什么负载平均和 %CPU 与下面的进程 CPU 使用率不匹配。似乎该进程正在消耗大量 CPU,而 AWS EC2 计量器仅显示使用了 25% 的 CPU。
【问题讨论】:
标签: linux performance amazon-web-services amazon-ec2 server
我真的很困惑。为什么负载平均和 %CPU 与下面的进程 CPU 使用率不匹配。似乎该进程正在消耗大量 CPU,而 AWS EC2 计量器仅显示使用了 25% 的 CPU。
【问题讨论】:
标签: linux performance amazon-web-services amazon-ec2 server
运行命令“top”后,您可以按键盘上的“1”查看各个 CPU 利用率,运行命令“man top”时可以查看更多详细信息 注意进程“msqld”可以使用多个资源的 CPU,并且它的利用率在“top”显示中很容易超过 100%。
【讨论】:
%CPU -- CPU 使用率:进程使用的 CPU 百分比。 默认情况下,
top将其显示为百分比 单个 CPU。 在多核系统上,您可以有百分比 大于 100%。例如,如果 3 个核心的使用率为 60%,top将显示 CPU 使用率为 180%。 您可以通过在top运行时按 Shift+i 来切换此行为,以显示可用的总体百分比 正在使用的 CPU。
load average: 22.56, 24.99, 26.51
从左到右,这些数字显示过去 1 分钟、过去 5 分钟和过去 15 分钟的平均负载强>。
us -- User CPU time
The time the CPU has spent running users' processes that are not niced.
sy -- System CPU time
The time the CPU has spent running the kernel and its processes.
ni -- Nice CPU time
The time the CPU has spent running users' proccess that have been niced.
wa -- iowait
Amount of time the CPU has been waiting for I/O to complete.
hi -- Hardware IRQ
The amount of time the CPU has been servicing hardware interrupts.
si -- Software Interrupts
The amount of time the CPU has been servicing software interrupts.
st -- Steal Time
The amount of CPU 'stolen' from this virtual machine by the hypervisor for other tasks (such as running another virtual machine).
从In Linux “top” command what are us, sy, ni, id, wa, hi, si and st (for CPU usage)查看更多详情。
【讨论】:
您好,您使用单核和其他核的应用可能是免费的。我认为您的实例有 4 个 CPU 核心,其中一个正在使用 100%。你能检查每个核心的利用率吗?
【讨论】: