<ul>
<li><p>Throttling stats are available in <code>/sys/fs/cgroup/cpu/cpu.stat</code></p>
</li>
<li><p>As per documentation of k8s CPU requests, the number is translated<br />
into a value that goes into <code>/sys/fs/cgroup/cpu/cpu.shares</code></p>
</li>
<li><p>If container A on a node has <code>cpu.shares</code> value twice that of
container B, then it will get twice amount of time if both are trying to run simultaneously.</p>
</li>
<li><p>Is this considered as throttling for container B based on
<code>cpu.shares</code> value?</p>
</li>
<li><p>If so, how can we measure this kind of throttling?</p>
</li>
</ul>

Sameer Naik
<p>First of all CPU shares don't make sense until after CPU pressure occurs. As long as there is enough CPU all tasks may run for as much time as they want.</p>
<p>Second, CPU requests do not cause throttling, only limits do. For more details please read more about <a href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/" rel="nofollow noreferrer">Quality of Service for Pods</a>.</p>
<p>You can measure CPU throttling due to CPU limits using Metrics-server or Prometheus like that: <a href="https://github.com/kubernetes-monitoring/kubernetes-mixin/blob/master/alerts/resource_alerts.libsonnet#L143" rel="nofollow noreferrer">https://github.com/kubernetes-monitoring/kubernetes-mixin/blob/master/alerts/resource_alerts.libsonnet#L143</a></p>
