Google Cloud Compute引擎CPU使用率显示为100%,但仪表板仅显示10% [英] Google Cloud Compute engine CPU usage shows 100% but dashboard only shows 10% usage

查看:156
本文介绍了Google Cloud Compute引擎CPU使用率显示为100%,但仪表板仅显示10%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个多处理程序,我希望CPU使用率接近100%.当我运行top命令时它确实显示了100%

I am running a multiprocessing program and i expect the CPU usage to be close to 100%. It did show 100% when i run top command

但是,仪表板似乎只显示了10%的使用率

However, the dashboard seem only shows 10% usage

我的机器设置如下:

我很好奇这是否是Google Cloud的问题?还是我误解了一些概念?

I am curious whether this is the problem of google cloud? or i am misunderstanding some concept?

推荐答案

在特定进程行的top输出中,100%指的是单个CPU内核(如操作系统所见),而不是全部.如果按 1 top还将显示每个内核的CPU使用率,则只会看到一个内核实际上处于/接近100%繁忙状态.

In the top output on a particular process row the 100% refers to a single CPU core (as seen by the OS), not all of them. If you press the 1 key top will also display the per-core CPU usage, you'll see only one core being actually at/close to 100% busy.

由于实例上有8个核心,因此总体使用率将为100%/8 = 12.5%-几乎与图表一致.

Since you have 8 cores on your instance your overall usage would be 100% / 8 = 12.5% - pretty much inline with the graph.

可能相关-假设您在top输出中显示的python进程是您感兴趣的进程,您应该知道它不能在多个内核上运行,请参见

Maybe relevant - assuming the python process you're showing in the top output is the one you're interested in you should know it can't run on multiple cores, see Python threads all executing on a single core.

因此,如果您希望提高CPU使用率,则必须将python应用程序拆分为多个进程,而不是线程.

So if you're expecting to bump your CPU usage you'd have to split your python application into multiple processes, not threads.

这篇关于Google Cloud Compute引擎CPU使用率显示为100%,但仪表板仅显示10%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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