Q:

How many cores do kubernetes pods use when it's CPU usage is limited by policy?

Kubernetes allows to limit pod resource usage.
requests:
  cpu: 100m
  memory: 128Mi
limits:
  cpu: 200m   # which is 20% of 1 core
  memory: 256Mi

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 1Core's 200m or 2Core's 100m+100m?
This calculation is needed for my gunicorn worker's number formula, or nginx worker's number etc..
In gunicorn documentation it says 

Generally we recommend (2 x $num_cores) + 1 as the number of workers
  to start off with.

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?
TLDR: How many cores do pods use when its cpu usage is limited by kubernetes? If I run top 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%..

A:

It will limit to 20% of one core, i.e. 200m. Also, limit means a pod can touch a maximum of that much CPU and no more. So pod CPU utilization will not always touch the limit.
Total CPU limit of a cluster is the total amount of cores used by all nodes present in cluster.
If you have a 2 node cluster and the first node has 2 cores and second node has 1 core, K8s CPU capacity will be 3 cores (2 core + 1 core). If you have a pod which requests 1.5 cores, then it will not be scheduled to the  second node, as that node has a capacity of only 1 core. It will instead be scheduled to first node, since it has 2 cores.

