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

Use physical-cpu-count #18

Closed
aleclarson opened this issue Jan 3, 2022 · 4 comments
Closed

Use physical-cpu-count #18

aleclarson opened this issue Jan 3, 2022 · 4 comments

Comments

@aleclarson
Copy link

https://www.npmjs.com/package/physical-cpu-count

Working with clusters of Node.js processes it is common to see code using os.cpus().length as the number of child workers to fork. For some workloads this can negatively impact performance on CPUs that use simultaneous multithreading (SMT). Latency is doubled because two processes share the same physical CPU core to get their work done. Additionally there is memory spent for each running worker, as well as time to spawn their processes. It is better to fork no more child processes than there are physical cores.

@Aslemammad
Copy link
Member

Oh, thank you for your issues. If you are interested in sending a PR, feel free. if not, I can take it!

@aleclarson
Copy link
Author

You can take this one 😊

@Aslemammad
Copy link
Member

Sure, I'll release in minutes if possible!

@Aslemammad
Copy link
Member

Aslemammad commented Jan 3, 2022

Released in v0.0.8 (v0.1.0)

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

No branches or pull requests

2 participants