<p>I found two interpretations to a formula used for over-provisioning resources in <a href="https://cloud.google.com/kubernetes-engine" rel="nofollow noreferrer">GKE</a> when autoscaling.</p>
<p>According to the following two sources:</p>
<ul>
<li><p><a href="https://cloud.google.com/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke#autoscaler_and_over-provisioning" rel="nofollow noreferrer">Autoscaler and over-provisioning</a></p>
</li>
<li><p><a href="https://www.youtube.com/watch?v=VNAWA6NkoBs&amp;t=403s" rel="nofollow noreferrer">Autoscaling with GKE: Clusters and nodes</a></p>
</li>
</ul>
<p>the formula:</p>
<pre><code>(1 - buffer) / (1 + traffic)
</code></pre>
<p>where:</p>
<pre><code>buffer: percentage of CPU buffer that you reserve, so your workloads do not get to 100% CPU utilization

traffic: percentage of traffic increase(expected) in the following two or three minutes
</code></pre>
<p>Will give you the value of a <em>new resource utilization target for the HPA</em> to appropriately handle the expected traffic growth while minimizing extra resources allocation.</p>
<p>So, for example, if you have the following values:</p>
<pre><code>buffer: 15%, so you would get a CPU utilization of up to 85%
traffic: 30% increase in the next two or three minutes
target utilization = (1 - 0.15) / (1 + 0.30) = 0.85 / 1.3 = 0.65384615
target utilization = 65%
</code></pre>
<p>The interpretation from those two sources would be that <strong>65% is the optimized target utilization for the HPA</strong>. Then, you <strong>get a 35% of over-provisioned resources</strong> to schedule new pods in existing nodes while the Cluster auto-scaler(and node auto-provisioner) will allocate new nodes during a peak in demand.</p>
<p>The problem is that the laboratory <a href="https://www.qwiklabs.com/focuses/15636?parent=catalog" rel="nofollow noreferrer">Understanding and Combining GKE Autoscaling Strategies</a> in the section <a href="https://www.qwiklabs.com/focuses/15636?parent=catalog#step11" rel="nofollow noreferrer">&quot;Optimize larger loads&quot;</a> (version: Manual Last Updated: March 19, 2021) establishes that the 65% value would be the percentage of over-provisioned resources you need to allocate in excess.</p>
<p>So, according to the first two sources:</p>
<ul>
<li>percentage of resources to overprovision: 35%</li>
</ul>
<p>But according to the laboratory &quot;Understanding and Combining GKE Autoscaling Strategies&quot;:</p>
<ul>
<li>percentage of resources to overprovision: 65%</li>
</ul>
<p>Which one is the correct interpretation?</p>
<p>IMHO, the correct interpretation is that the value of over-provision equals 35%. The formula gives you a new resource utilization target for the HPA concerning the (new) traffic demand (and not the percentage of resources to allocate in excess).</p>

Guillermo Ampie
<p>Yes, the first interpretation is correct. In the first interpretation, they compute over-provisioning as the unused resources over the total size of the cluster, since Horizontal Pod Autoscaling is configured to keep resource utilization to ~65%, you have a 100% - 65% = 35% unused resources which is the value of a new target resource utilization for the HPA.</p>
<p>In the second interpretation i.e., &quot;Understanding and Combining GKE Autoscaling Strategies&quot;, they seem to consider &quot;over-provisioning percent&quot; as how much more computing power is added to the “needed&quot; compute resources. In other words, you have a 3 node cluster, needed to run your workload, and you add 2 nodes on top, this makes it such that you have over-provisioned the cluster by 2/3 = 66.6666% ~= 65%.</p>
<p>The first interpretation is more intuitive and makes more sense in practical usage.</p>
