1

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

Wacas
  • 11
  • 1
  • 2

2 Answers2

2

The CPU usage shown in Google Cloud Console is not that of the instance, but the CPU usage of the hypervisor managing the instance. This hypervisor is in charge of providing the virtualization services to the instance and collecting all the metrics used for load balancing, auto-scaling, cloud monitoring, etc. As such, high numbers of I/O or network operations will cause the CPU utilization shown in Cloud Console to spike.

Wilfred L.
  • 41
  • 3
1

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.

surfingonthenet
  • 715
  • 3
  • 7