title: How is CPU usage calculated in Grafana?
body: <p>Here's an image taken from Grafana which shows the CPU usage, requests and limits, as well as throttling, for a pod running in a K8s cluster.</p>
  <p><a href="https://i.stack.imgur.com/9hXoh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9hXoh.png" alt="enter image description here" /></a></p>
  <p>As you can see, the CPU usage of the pod is very low compared to the requests and limits. However, there is around 25% of CPU throttling.</p>
  <p>Here are my questions:</p>
  <ol>
  <li>How is the CPU usage (yellow) calculated?</li>
  <li>How is the ~25% CPU throttling (green) calculated?</li>
  <li>How is it possible that the CPU throttles when the allocated resources for the pod are so much higher than the usage?</li>
  </ol>
  <p>Extra info:</p>
  <p>The yellow is showing <code>container_cpu_usage_seconds_total</code>.
  The green is <code>container_cpu_cfs_throttled_periods_total / container_cpu_cfs_periods_total</code></p>