<p>After some research, I found out that, <code>kubernetes logs -f &lt;pod&gt; </code>reads logs from files, i.e, .log files to which docker containers running inside the pods have written the logs. In my case, docker container is an application that I have written. Now, say I have disabled logging in my application expecting that RAM usage on the system will reduce.</p>
<ol>
<li><p>With logging enabled in my application, I kept track of CPU and MEM usage</p>
<p>Commands used:</p>
<p>a. <code>top  | grep dockerd</code></p>
<p>b. <code>top  | grep containerd-shim</code></p>
</li>
<li><p>Without logging enabled also, I kept track of CPU and MEM usage.</p>
</li>
</ol>
<p>But I didn't find any difference. Could anyone explain what is happening here internally?</p>

<p>The simple explanation:</p>
<ul>
<li>Logging doesn't use a lot of RAM. As you said, the logs are written to disk as soon as they are processed so they are not stored in memory other than just one time variables used per log entry.</li>
<li>Logging doesn't use a lot of CPU cycles. The CPU is typically at least <a href="https://liw.fi/magnitudes/" rel="nofollow noreferrer">10 to the -5</a> orders of magnitude faster than disk (less for SSDs) so your CPU can do a lot more when logs are written to disk. In other words, you'll barely notice the difference when disabling the logs in terms of CPU usage.</li>
</ul>
