<p>I have a pod in kubernetes where it's slowing down under heavy load. The pod has two containers -- Nginx and PHP.</p>

<p>I see that Nginx is set to use "100m" CPU and PHP is set to use 1 CPU (1 core). I'm suspecting that Nginx might be bottleneck, but I'm having hard time to determine it.</p>

<p>This is my Kube setting for the nginx.</p>

<pre><code> resources:
      limits:
        cpu: 100m
        memory: 128M
      requests:
        cpu: 100m
        memory: 128M
</code></pre>

<p>When I SSH into Nginx container and use "top" command, I see 1% CPU pretty much all the time. I never see it goes over 1%.</p>

<p><code>7 nginx     20   0   31972   2360    972 S   0.7  0.0   7:07.94 nginx
 1 root      20   0   31480   1784    976 S   0.0  0.0   0:00.01 nginx
</code></p>

<p>Is that mean that Nginx container is limited to 1% CPU usage because I set the CPU request to 100m?</p>

<p>Am I reading it correctly? or is there a standard way of reading CPU usage of a single container in a pod?</p>

Moon
<p>To check the pods that use most memory and CPU, you can use the kubectl top command, but it doesn't sort the pods on basis of highest usage. You can only see the current usage of pods.</p>

<pre><code>$ kubectl top pod --all-namespaces
NAMESPACE NAME CPU(cores) MEMORY(bytes)
kube-system kube-proxy-gke-rel3170-default-pool-3459fe6a 2m 12Mi
kube-system kube-proxy-gke-rel3170-default-pool-3459fe6a 2m 12Mi
kube-system fluentd-gcp-v2.0.9-5t9q6 8m 85Mi
kube-system fluentd-gcp-v2.0.9-pd4s9 10m 84Mi
</code></pre>

<p>However it doesn't show the quota limits of pods. It just shows current CPU and memory usage of pod.
Hope this helps.</p>
