了解平均负载与 CPU 使用率 [英] Understanding load average vs. cpu usage

查看:16
本文介绍了了解平均负载与 CPU 使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我自己是一个 Windows 用户,所以我对 Linux-y 类型的东西的了解有点有限.

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

但是,我的一般理解是,平均负载"表示在任何给定时间运行了多少处理,平均在最后一分钟、五分钟和...十五分钟内?

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!

我一直在观看 top 并注意到一些似乎与我认为我知道的相反的东西.

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

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

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?

为什么,那么它显示的是 50.0%id?怎么可能有一半空闲?

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

推荐答案

top 显示正在运行的进程的 CPU 利用率,而 load average 显示(自 1993 年以来)正在运行的进程数加上处于不间断状态的进程数.等待工作的进程不消耗 CPU.结果 top CPU 利用率低于 7/8 * 100%.

top shows CPU utilization for running processes while load average shows (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 top CPU utilization is less that 7/8 * 100%.

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

这篇关于了解平均负载与 CPU 使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆