-
Notifications
You must be signed in to change notification settings - Fork 19
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: Use env variable to configure number of workers #1233
Conversation
@@ -64,7 +64,10 @@ export class Multiprocess extends EventEmitter { | |||
this.work() | |||
return | |||
} | |||
let processes = options.workers || cpus().length // TODO workers = -1 or undef means no workers |
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.
Would be good to understand why cpus()
is returning incorrect results in the first place.
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.
Otherwise this means having to constantly keep the env var updated when updating CAS resources in k8s.
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.
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.
And changed the code to use settings from what's inside the Docker.
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.
Nice!! Thanks 😊
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1233 +/- ##
==========================================
Coverage ? 75.30%
==========================================
Files ? 45
Lines ? 1936
Branches ? 320
==========================================
Hits ? 1458
Misses ? 478
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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.
🚀
If env variable
MULTIPROCESS_SIZE
(as a decimal number) is set, it takes precedence over nodejscpus().length
ofnode:os
.That should fix a bug of "having" 32 processors on k8s regardless of the underlying number of CPUs.