问题
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