I have a windows desktop with this configuration: Intel Xeon(R) CPU E5645 @2.40GHz (2 processors)
with 24 GB RAM and 64-bit OS
When I run following code.
var cpuCount = require('os').cpus().length;
It returns cpuCount as 24
Can someone please explain what exactly does this mean? And how does it determine that I have 24 CPUs with just 2 processors.
http://ark.intel.com/products/48768/Intel-Xeon-Processor-E5645-12M-Cache-2_40-GHz-5_86-GTs-Intel-QPI?q=Xeon%20e5645
Advanced Technologies section. It says that your CPU supports Hyper-Threading
From the Wikipedia:
For each processor core that is physically present, the operating system addresses two virtual or logical cores ...
So, you have two processors with 6 physical cores each (but 12 logical or virtual):
(2 x 6) x 2 = 24
Also check out node.js docs:
os.cpus()
Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq).
That's why array returned by require('os').cpus() contains 24 elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With