{"id":11448,"date":"2025-08-17T16:22:13","date_gmt":"2025-08-17T16:22:13","guid":{"rendered":"https:\/\/putridparrot.com\/blog\/?p=11448"},"modified":"2025-08-17T16:22:13","modified_gmt":"2025-08-17T16:22:13","slug":"investigating-pod-resources-and-usage","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/investigating-pod-resources-and-usage\/","title":{"rendered":"Investigating pod resources and usage"},"content":{"rendered":"<p><strong>Top<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkubectl top pod\r\n\/\/ Or we could use labels, for example app=ui, app=proxy etc.\r\nkubectl top pod -l &#039;app in (ui, proxy, api)&#039; -n my-namespace\r\n<\/pre>\n<p><strong>Check the pods configuration<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkubectl describe pod &lt;pod-name&gt; | grep -A5 &quot;Limits&quot;\r\n<\/pre>\n<p>Prints the five lines after the &#8220;Limits&#8221; section, for example<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nLimits:\r\n  cpu:     500m\r\n  memory:  1Gi\r\nRequests:\r\n  cpu:      50m\r\n  memory:   256Mi\r\n<\/pre>\n<p><strong>Resource Quotas<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkubectl get resourcequotas\r\nkubectl get resourcequotas -n my-namesapce\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkubectl describe resourcequota {name from above call} -n my-namespace\r\n<\/pre>\n<p><strong>CPU Throttling<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkubectl exec &lt;pod-name&gt; -- cat \/sys\/fs\/cgroup\/cpu.stat\r\nkubectl exec &lt;pod-name&gt; -- cat \/sys\/fs\/cgroup\/cpu\/cpu.stat\r\n<\/pre>\n<p>For example<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nusage_usec 177631637\r\nuser_usec 89639616\r\nsystem_usec 87992020\r\nnr_periods 191754\r\nnr_throttled 271\r\nthrottled_usec 11291159\r\n<\/pre>\n<p>&#8211; nr_periods \u2013 The number of scheduling periods that have occurred.<br \/>\n&#8211; nr_throttled \u2013 The number of times the process was throttled due to exceeding CPU limits.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Top kubectl top pod \/\/ Or we could use labels, for example app=ui, app=proxy etc. kubectl top pod -l &#039;app in (ui, proxy, api)&#039; -n my-namespace Check the pods configuration kubectl describe pod &lt;pod-name&gt; | grep -A5 &quot;Limits&quot; Prints the five lines after the &#8220;Limits&#8221; section, for example Limits: cpu: 500m memory: 1Gi Requests: cpu: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[314],"tags":[],"class_list":["post-11448","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/11448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=11448"}],"version-history":[{"count":4,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/11448\/revisions"}],"predecessor-version":[{"id":11452,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/11448\/revisions\/11452"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=11448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=11448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=11448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}