-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(global-options): Default concurrency to logical CPU count #1931
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'm concerned that os.cpus().length
isn't always the appropriate value for concurrent operations. Not that 4
is much better, it's pretty arbitrary.
(My concerns aside, I'm in favor of this change) |
I agree. But when it's not, my guess is they probably have a hard coded number in mind anyway, so they can just set the concurrency if they want. If people wanted to use half of the cpus, or all but one, they'd need a node script to do that. But that's the case today today, and if it was that popular of a request, there could be options such as |
too long and it mangles the help output
FYI, it seems that this feature caused us some grief in CircleCI where running a command across 30+ packages would randomly fail on one of the packages with:
We fixed it by explicitly adding |
CircleCI doesn't report number of cores correctly so this fails on it without concurrency being added explicitly 😞 |
Sounds like a Circle CI bug to me. |
Description
The PR makes little changes to set concurrency option to count of logical CPU cores by default.
Motivation and Context
--concurrency
option is set to4
by default what can be not the best value with different count of CPUs.Setting the option to specific number isn't good options cause the same script can be run on different servers.
Fixes #1929
How Has This Been Tested?
Unfortunately, my computer have 4 logical CPU what was the value before my changes, so for now I didn't test what is effected. I'm going to run lerna tests in virtual environments with different count of CPU cores.
Types of changes
Checklist: