My computer's CPU is AMD 9754, with 128 cores and 256 logic processors. But why does nodejs get 64 through os. cpu(). length? How to obtain the correct logical processor
Node.js Version
v22.3.0
NPM Version
10.8.1
Operating System
Windows 11 Professional Workstation Edition
Subsystem
child_process, cluster, v8
Description
My computer's CPU is AMD 9754, with 128 cores and 256 logic processors. But why does nodejs get 64 through os. cpu(). length? How to obtain the correct logical processor
Minimal Reproduction
import os from 'os'
console.log(os.cpus().length)
Output
Before You Submit
- [X] I have looked for issues that already exist before submitting this
- [X] My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
@nodejs/os PTAL
@nodejs/os PTAL
What does this mean? I didn't understand @RedYetiDev
"PTAL" means "Please Take A Look", and the @nodejs/os means that I pinged the OS team.
Stalled for the @nodejs/os team to take a look. If they don't in a few more days I'll reach out.
Sometimes, it may be a limitation that has been implemented within Node.js
what does systeminfo command say on the number of processors?
https://github.com/nodejs/node/blob/2c86f6a490caa3ff86be345e0a887233ffb823a2/deps/uv/src/win/util.c#L548-L549
is responsible for obtaining CPU count in windows, which I believe is inline with systeminfo command o/p.
@gireeshpunathil
@wangzhiguoengineer - thanks, can you also run systeminfo command and share the relevant part of the output?
Hi! It's been a while since any activity on this issue, and we are currently waiting author response. If no activity occurs in the next month, this issue will be closed.