<p>This is a bit crazy, but we run a kubernetes cluster with 4 nodes (w/ Docker as container engine):</p>
<ul>
<li>node01/node02: 8 cores</li>
<li>node03/node04: 4 cores</li>
</ul>
<p>I am confusing about exactly what pod resource request cpu give as real cpu for a containerized application.</p>
<p>In my understanding, pods from a deployment that request 1 CPU, will all have the same cpu shares, so this mean a container will run faster on node01/node02 than 03/04 ?</p>

Thomas Decaux
<p>Not necessarily:</p>
<ul>
<li>If the application is single-threaded, it will run at the same speed no matter how many cores the system it's on has.</li>
<li>If the application is disk- or database-bound, adding more cores won't make it go faster.</li>
<li>If other pods (or non-Kubernetes processes) are running on either of the nodes, those share the CPU resource, and a busy 8-core system could in practice be slower than an idle 4-core system.</li>
<li>If the pod spec has <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/" rel="nofollow noreferrer">resource requests</a>, it could be prevented from running on the smaller system
<pre class="lang-yaml prettyprint-override"><code>resources:
   requests:
     cpu: 6 # can't run on the 4-core system
</code></pre>
</li>
<li>If the pod spec has resource limits, that can prevent it from using all of the cores, even if it's scheduled on the larger system
<pre class="lang-yaml prettyprint-override"><code>resources:
   limits:
     cpu: 3 # even if it's scheduled on the 8-core system
</code></pre>
</li>
</ul>
