Gaaaaaaaa
Gaaaaaaaa

Reputation: 167

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

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 enter image description here

However, the dashboard seem only shows 10% usage enter image description here

My Machine Setup is as follow:

enter image description here

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

Upvotes: 1

Views: 3261

Answers (1)

Dan Cornilescu
Dan Cornilescu

Reputation: 39814

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.

Upvotes: 4

Related Questions