<p>I am deploying some pods in Azure Kubernetes Service. When I deploy the pods with CPU requests for 100m I can see the 5 pods are running. Now with this state I run some performance tests and benchmark my result.
Now I redeploy the pods with CPU requests of 1 CPU and run same tests again. I can see that the pods are created successfully in both the cases and are in running state.
Shouldnt I see better performance results? Can someone please explain. Below is deployment file. CPU request for first test is 100m and for second is 1. If no performance difference is expected how to improve performance?</p>
<pre><code>resources:
         limits:
            cpu: 3096m
            memory: 2Gi
         requests:
            cpu: 100m
            memory: 1Gi
</code></pre>

ckv
<p><code>CPU requests</code> are mostly more important for the <code>kube-scheduler</code> to identify the best node suitable to place a pod. If you set <code>CPU requests = 1</code> for every workload there will be no more capacity soon to schedule new pods.</p>
<p>Furthermore assigning more CPU <code>requests</code> to a pod does not automatically mean that the container/application will consume this.</p>
<p><code>CPU limits</code> on the other hand can be responsible for CPU throttling in Kubernetes bcs they limit the time pods can consume the CPU.</p>
<p><a href="https://medium.com/omio-engineering/cpu-limits-and-aggressive-throttling-in-kubernetes-c5b20bd8a718" rel="nofollow noreferrer">Here</a> is a great article about it.</p>
<p>Basically there are a lot of articles about about to no limit the CPU to avoid kernel throttling but from my experience throttling of a pod is less harmless than a pod going crazy and consume the whole CPU of a node. So i would recommend to not overcommit resources and set requests=limits.</p>
<p>You can also check the capacity and allocated resources of your nodes:</p>
<p><code>kubectl describe node &lt;node&gt;</code>:</p>
<pre><code>Capacity:
  cpu:                            4
  ephemeral-storage:              203070420Ki
  memory:                         16393308Ki
Allocatable:
  cpu:                            3860m
  ephemeral-storage:              187149698763
  memory:                         12899420Ki


Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource                       Requests      Limits
  --------                       --------      ------
  cpu                            1080m (27%)   5200m (134%)
  memory                         1452Mi (11%)  6796Mi (53%)
</code></pre>
