<p>We are running a single NodeJS instance in a Pod with a request of 1 CPU, and no limit. Upon load testing, we observed the following:</p>
<pre><code>NAME                                                CPU(cores)   MEMORY(bytes)
backend-deployment-5d6d4c978-5qvsh                  3346m        103Mi
backend-deployment-5d6d4c978-94d2z                  3206m        99Mi
</code></pre>
<p>If NodeJS is only running a single thread, how could it be consuming more than 1000m CPU, when running directly on a Node it would only utilize a single core? Is kubernetes somehow letting it borrow time across cores?</p>

danthegoodman
<p>Although Node.js runs the main application code in a single thread, the Node.js runtime is multi-threaded.  Node.js has an internal <a href="https://nodejs.org/en/docs/guides/dont-block-the-event-loop/" rel="nofollow noreferrer">worker pool</a> that is used to run background tasks, including I/O and certain CPU-intensive processing like crypto functions.  In addition, if you use the <a href="https://nodejs.org/api/worker_threads.html" rel="nofollow noreferrer">worker_threads</a> facility (not to be confused with the worker pool), then you would be directly accessing additional threads in Node.js.</p>
