<p>I am running 3 deployments of the same app on a kubernetes cluster. I recently got around to setting resource requests and limits for one of the deployments. </p>

<pre><code>resources:
    limits:
        cpu: 350m
        memory: 225Mi
    requests:
        cpu: 250m
        memory: 150Mi
</code></pre>

<p>After setting these, the affected pods have a much higher computation time compared to the <strong>2 unchanged deployments</strong>, which does not make sense regarding kubernetes documentation as I understand it.</p>

<p>Running <code>kubectl top pods</code> allows me to confirm my pods are running at or below requested resources. When visualizing computation time (Prometheus+Grafana), it is clear one of the deployments is significantly slower:</p>

<p><a href="https://i.stack.imgur.com/5QXN0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5QXN0.png" alt="enter image description here"></a> </p>

<p><em>Two deployments at ~ 60ms and one at ~ 120ms</em></p>

<p>As this is the only change I have made, I don't understand why there should be any performance degradation. Am I missing something?</p>

<hr>

<h1>Edit</h1>

<p>Removing the cpu <code>limit</code> but keeping the <code>request</code> brings pod performance back to what it's supposed to be. Keeping in mind that these pods are running at cpu request level (around 250mCPU) which is 100mCPU below the limit.</p>

<p><a href="https://i.stack.imgur.com/LjSKm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LjSKm.png" alt="enter image description here"></a> </p>

<p><em>Additional information: these pods are running a NodeJS app.</em></p>

Nicolas Gaborel
<p>Reading this link i understand that if a pod is successfully started, the container is guaranteed the amount of resources requested so scheduling is based on requests field in yaml and not the limit field but the pods and its containers will not be allowed to exceed the specified limit on yaml.</p>

<p><strong><em>Pods will be throttled if they exceed their limit. If limit is unspecified, then the pods can use excess CPU when available.</em></strong></p>

<p>Refer the link for complete read 
<a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/resource-qos.md#compressible-resource-guarantees" rel="nofollow noreferrer">https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/resource-qos.md#compressible-resource-guarantees</a></p>
