help icon indicating copy to clipboard operation
help copied to clipboard

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

Open wangzhiguoengineer opened this issue 1 year ago • 6 comments

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

  • [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

wangzhiguoengineer avatar Jul 03 '24 14:07 wangzhiguoengineer

@nodejs/os PTAL

avivkeller avatar Jul 03 '24 17:07 avivkeller

@nodejs/os PTAL

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

wangzhiguoengineer avatar Jul 04 '24 04:07 wangzhiguoengineer

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

avivkeller avatar Jul 04 '24 12:07 avivkeller

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

avivkeller avatar Jul 07 '24 03:07 avivkeller

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

KalharaBatangala avatar Aug 20 '24 04:08 KalharaBatangala

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 avatar Sep 06 '24 02:09 gireeshpunathil

@gireeshpunathil image

wangzhiguoengineer avatar Nov 03 '24 17:11 wangzhiguoengineer

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

gireeshpunathil avatar Nov 04 '24 07:11 gireeshpunathil

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.

avivkeller avatar Mar 31 '25 19:03 avivkeller