Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #4435

Open
2 tasks done
wangzhiguoengineer opened this issue Jul 3, 2024 · 8 comments

Comments

@wangzhiguoengineer
Copy link

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

image

image

Before You Submit

  • I have looked for issues that already exist before submitting this
  • 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
@RedYetiDev
Copy link
Member

@nodejs/os PTAL

@wangzhiguoengineer
Copy link
Author

@nodejs/os PTAL

What does this mean? I didn't understand @RedYetiDev

@RedYetiDev
Copy link
Member

"PTAL" means "Please Take A Look", and the @nodejs/os means that I pinged the OS team.

@RedYetiDev RedYetiDev added the stalled issues that did not receive response for a month label Jul 7, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Jul 7, 2024

Stalled for the @nodejs/os team to take a look. If they don't in a few more days I'll reach out.

@KalharaBatangala
Copy link

Sometimes, it may be a limitation that has been implemented within Node.js

@gireeshpunathil
Copy link
Member

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.

@RedYetiDev RedYetiDev removed the stalled issues that did not receive response for a month label Sep 6, 2024
@wangzhiguoengineer
Copy link
Author

@gireeshpunathil
image

@gireeshpunathil
Copy link
Member

@wangzhiguoengineer - thanks, can you also run systeminfo command and share the relevant part of the output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants