理解“顶级” CPU使用率

发布于 2024-07-25 10:34:38 字数 1552 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

心的憧憬 2024-08-01 10:34:39

有 4 x 100%,因此“顶部”显示 4 CPU 机箱上总共 400%。

There are 4 x 100%, so "top" shows a total of 400% on a 4 CPU box.

撩动你心 2024-08-01 10:34:39

每个cpu进程都被认为是100%。 所以总共是 4 个 cpu 的 400%。

Each cpu process is consider as 100% . So totatlly it 400% of 4 cpu.

幼儿园老大 2024-08-01 10:34:38

在 *NIX 环境中,100% cpu 使用率是单个 cpu 的 100%。

这适用于多核处理器,就像真正的多处理器计算机一样。

因此,您在 mysql 上使用了总 CPU 周期的 7/8。

In *NIX land, 100% cpu usage is 100% of a SINGLE cpu.

This applies to multi-core processors the same way as true multi-processor computers.

So, you are using 7/8th of your total CPU cycles on mysql.

土豪我们做朋友吧 2024-08-01 10:34:38

运行 top 时,按“1”。 这将切换视图,以便您可以看到每个核心/CPU 的负载。

While running top, press "1". This will toggle the view so that you can see the load per individual core/cpu.

陈独秀 2024-08-01 10:34:38

我昨天刚刚读了一篇关于这个主题的有趣文章:Unix 平均负载。 它将解释您需要了解的所有内容以及更多内容。

提炼 :

平均负载是运行队列长度与当前在 CPU 上运行的作业数量之和。 在 Solaris 2.0 和 2.2 中,平均负载不包括正在运行的作业,但此错误在 Solaris 2.3 中已修复。

考虑有两种显示负载的基本模式:“IRIX 模式”和“Solaris 模式”。 在 IRIX 模式(Linux 默认)下,平均负载为 1 意味着一个 CPU 已满载(或 4 CPU 系统上每个 CPU 的 25% 等)。 在 Solaris 模式下,平均负载为 1 意味着所有 CPU 均已满载(因此实际上等于“IRIX 模式”负载除以CPU 计数 em>)。

I've just read an interesting article on this very subject yesterday : Unix load average. It will explain all you need to know and more.

Extract :

The load average is the sum of the run queue length and the number of jobs currently running on the CPUs. In Solaris 2.0 and 2.2 the load average did not include the running jobs but this bug was fixed in Solaris 2.3.

Consider that there are two basic modes to display load : "IRIX mode" and "Solaris mode". In IRIX mode (Linux default), a load average of 1 means that one CPU is fully loaded ( or 25% of each CPU on a 4 CPU system, etc). In Solaris mode, a load average of 1 means that all CPUs are fully loaded (so it's actually equivalent to "IRIX mode" load divided by CPU count ).

极致的悲 2024-08-01 10:34:38

平均负载显示有多少进程正在队列中等待(根据 CPU 数量进行调整)。 对于一个 CPU,平均负载为 1.0 意味着该 CPU 能够以最佳方式完全处理队列上的所有请求 — 没有进程在等待 CPU,并且没有 CPU 周期被浪费(即空闲)。 平均负载为 2.0(在单核系统上(意味着一半的进程将等待在 CPU 上运行的机会:-( 平均负载为 0.33 意味着系统上的负载非常少,以至于2/3 的时间 CPU 基本上什么都不做,只是等待更多进程运行。

top 显示的 CPU 百分比是衡量内核加载单个进程在 CPU 上运行的频率的指标,是一段时间内的平均值。因此,4 核系统上的 350% 意味着,在一段时间内,mysqld 将占用三个完整的 CPU 和第四个 CPU 的一半时间 - 即它有如此多的线程要运行,以至于它几乎无法运行。请求淹没 4 个核心。CPU 百分比并没有真正考虑等待队列(而平均负载则考虑在内):它是对特定时间帧内发生的情况的事后统计,但它确实显示了哪些进程。最近一直在使用CPU(s)

关于同一主题的另一篇详尽的文章:http://www.linuxjournal .com/article/9001

Load average shows how many processes are waiting on the queue (adjusted for the number of CPUs). With one CPU, a load average of 1.0 means that this CPU is able to fully process all requests on the queue optimally — no process is waiting for CPU, and no CPU cycles are wasted (i.e. idle). A load average of 2.0 (on a single-core system( would mean that half the processes would be waiting for a chance to run on the CPU :-( A load average of 0.33 would mean that there is so little load on the system that 2/3 of the time the CPU is basically doing nothing but waiting for more processes to run.

The CPU percentage shown by top is a measure of how often a single process is loaded by the kernel to run on the CPU, averaged over a period of time. So 350% on a 4-core system means that, for a period of time, mysqld would be taking over three full CPUs and half the time of the fourth CPU — i.e. it has so many threads to run that it pretty much swamps the 4 cores with requests. CPU percentage doesn't really take into account the waiting queues (while load average does): it's an after-the-fact statistic of what happened in a certain frame of time. But it certainly shows which processes have been using the CPU(s) recently.

Another thorough article on the same subject: http://www.linuxjournal.com/article/9001

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文