This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
有 4 x 100%,因此“顶部”显示 4 CPU 机箱上总共 400%。
There are 4 x 100%, so "top" shows a total of 400% on a 4 CPU box.
每个cpu进程都被认为是100%。 所以总共是 4 个 cpu 的 400%。
Each cpu process is consider as 100% . So totatlly it 400% of 4 cpu.
在 *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.
运行 top 时,按“1”。 这将切换视图,以便您可以看到每个核心/CPU 的负载。
While running top, press "1". This will toggle the view so that you can see the load per individual core/cpu.
我昨天刚刚读了一篇关于这个主题的有趣文章:Unix 平均负载。 它将解释您需要了解的所有内容以及更多内容。
提炼 :
考虑有两种显示负载的基本模式:“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 :
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 ).
平均负载显示有多少进程正在队列中等待(根据 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