dockercpu-usagecadvisor

Docker Container shows different CPU Usage with different tools


I am building a project inside the docker container without any resource limitation on creating the container. when I am monitoring it, I see the different results for CPU usage.

from ctop

enter image description here

From the Grafana (Full Node Exporter Chart)enter image description here

And from the cAdvisor enter image description here

I do not understand why the results are different, specially with ctop command. but my main question is, does Docker really use all CPUs? this machine has 16 vCPU and 16GB RAM


Solution

  • It's not exactly clear in the node exporter what instance or container you are monitoring, though it seems like the node exporter it showing the total machine CPU usage in 0-100 format and ctop shows in 100% per vCPU format. Also try using docker stats, that should show all running containers resource usage, from cpu to network and disk usage, when using it each vCPU would as 100% so your total will be 1600% for 16 vCPU.

    Regarding the cAdvisor output it doesn't show the same time range as the grafana node exporter so it would be hard to make a hard conclusion but it seems like similarly to ctop and docker stats it shows on a per core basis but instead of percentage it shows in 'cores' unit of measurement