Search code examples
prometheuscpu-usage

How to read container_cpu_cfs_throttled_seconds_total metric?


This is container_cpu_cfs_throttled_seconds_total metric. But I'm not sure how to read this graph ? I can see 27 seconds increment within 08.09.45 to 08.09.52. How this is possible ? enter image description here


Solution

  • You should wrap this metric into rate() function:

    rate(container_cpu_cfs_throttled_seconds_total[5m])
    

    It will show spikes at time ranges when there wasn't enough CPU resources for the container due to CPU limits. The returned non-zero value shows how many additional CPU cores were needed for the container to run without CPU throttling.