Google Cloud Compute engine CPU usage shows 100% but dashboard only shows 10% usage

浪子不回头ぞ 提交于 2020-04-18 17:03:40

问题


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

However, the dashboard seem only shows 10% usage

My Machine Setup is as follow:

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


回答1:


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.

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

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.

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



来源:https://stackoverflow.com/questions/53346844/google-cloud-compute-engine-cpu-usage-shows-100-but-dashboard-only-shows-10-us

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!