title: How many cores do kubernetes pods use when it's CPU usage is limited by policy?
body: <p>Kubernetes allows to limit pod resource usage.</p>
  
  <pre><code>requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 200m   # which is 20% of 1 core
    memory: 256Mi
  </code></pre>
  
  <p>Let's say my kubernetes node has 2 core. And I run this pod with limit of CPU: 200m on this node. In this case, will my pod use it's underlying node's <strong>1Core's 200m</strong> or <strong>2Core's 100m+100m</strong>?</p>
  
  <p>This calculation is needed for my <a href="http://docs.gunicorn.org/en/stable/design.html#how-many-workers" rel="noreferrer">gunicorn worker's number formula</a>, or nginx worker's number etc..
  In gunicorn documentation it says </p>
  
  <blockquote>
    <p>Generally we recommend (2 x $num_cores) + 1 as the number of workers
    to start off with.</p>
  </blockquote>
  
  <p>So should I use 5 workers? (my node has 2 cores). Or it doesn't even matter since my pod has only allocated 200m cpu and I should consider my pod has 1 core?</p>
  
  <p><em><strong>TLDR:</strong></em> How many cores do pods use when its cpu usage is limited by kubernetes? If I run <code>top</code> inside pod, I'm seeing 2 cores available. But I'm not sure my application is using this 2 core's 10%+10% or 1core's 20%..</p>