Linux 了解平均负载与 CPU 使用率

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21617500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:58:21  来源:igfitidea点击:

Understanding load average vs. cpu usage

linuxoperating-systemload

提问by Niet the Dark Absol

Okay, I'm very much a Windows user myself, so my knowledge of Linux-y type things is a bit limited.

好吧,我自己就是一个 Windows 用户,所以我对 Linux-y 类型的知识有点有限。

However it was my general understanding that "Load Average" is an indication of how many processed are being run at any given time, on average over the last minute, five minutes and... fifteen minutes?

然而,我的一般理解是“平均负载”表示在任何给定时间正在运行多少处理,平均在最后一分钟,五分钟和......十五分钟?

Anyway, I've been monitoring my server because we had a big opening and lots of people!

无论如何,我一直在监控我的服务器,因为我们有一个很大的空缺和很多人!

See?

看?

I've been watching topand noticed something that seemed contrary to what I thought I knew.

我一直在观察top并注意到一些似乎与我认为我所知道的相反的事情。

If the load average is at 7, with 4 hyper-threaded processors, shouldn't that means that the CPU is working to about 7/8 capacity?

如果平均负载为 7,具有 4 个超线程处理器,这是否意味着 CPU 以大约 7/8 的容量工作?

Why, then was it showing 50.0%id? How can it be idle half the time?

为什么,然后它显示 50.0%id?怎么能半天闲着呢?

采纳答案by Niet the Dark Absol

topshows CPU utilization for running processes while load averageshows (since 1993) number of running processes plus number of processes in the uninterruptible state. Processes waiting for work do not consume CPU. As a result topCPU utilization is less that 7/8 * 100%.

top显示正在运行的进程的 CPU 利用率,同时load average显示(自 1993 年以来)正在运行的进程数加上处于不可中断状态的进程数。等待工作的进程不消耗 CPU。因此,topCPU 利用率低于 7/8 * 100%。

Source: http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html

来源:http: //www.brendangregg.com/blog/2017-08-08/linux-load-averages.html