HIgh CPU Usage on Google Cloud Monitoring

google-cloud-platformgoogle-compute-enginegoogle-stackdriver

I am running a Google Cloud VM. Once I go to the monitoring Tab. I see that VM CPU utilisation is 70% as shown in screenshot also.

Google Cloud MOnitoring

But Once I SSH and use the terminal and use top command to view usage it shows only 5%. Anyone can help me please of which view to take seriously the google cloud one or the top command in terminal window.Thank you.

Terminal View for top command

Best Answer

In this case, I suggest you go to "Monitoring" -> "Metrics explorer" and create two metrics:

  • "VM Instances" and "agent.googleapis.com/cpu/utilization"
  • "VM Instances" and "compute.googleapis.com/instance/cpu/utilization"

so you can analyze CPU utilization from the host and container point of views.

From Google Cloud docs:

Metric: agent.googleapis.com/cpu/utilization

Description: CPU Usage (percent). This value is reported from inside the VM and can differ from compute.googleapis.com/instance/cpu/utilization, which is reported by the hypervisor for the VM.

Related Topic