educative.io

Educative

Why is the NumCPUS thread is 72

How did we determine number of CPU Thread is 72? Thanks.

Hi Sumanan_Jeyabalsinga,
Up to two threads can run simultaneously on a single CPU core. The number of cores in your machine or the number of cores multiplied by two is likely to be the ideal number of threads. Because adding more than two threads to a single core would make the core more complex without enhancing performance. It is not always possible to execute two threads simultaneously on a single CPU core. Initially, CPU cores were built to handle a single thread at a time. On a single core machine, a multitasking OS creates the appearance of executing many threads concurrently, but in reality it only keeps one thread active for a short period of time before switching to the next.

In this lesson, we have specified number of cores in a typical server is 32, so that’s why the number of threads is twice of the number of cores that means it’s 72.

We hope Educative has inspired you to further your learning, and please drop us a note if you have any other questions or concerns.
Thank you!
Happy learning