-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allows setting of parallelization options #2093
Conversation
66d17de
to
985fa0f
Compare
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.
This seems to be fixed upstream in: webpack-contrib/terser-webpack-plugin#21 via webpack-contrib/terser-webpack-plugin#90
Can you confirm that this is still an issue on the latest version? (otherwise, it looks 👍)
Thank you for the review. TersorPlugin gets cpu count in this line. When And the process is forked and executed by the number of maxConcurrentWorkers. For example, if the usable memory is 1GB and the CPU count is 4 cores and consumes 500MB per process, 1.5GB of memory is required in total and the build fails because of insufficient memory. |
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.
I am not sure if @gauravtiwari wants to pass settings differently, but it looks good from where I stand.
@masato-hi Could you please add documentation for this change? |
It seems that if you want to disable parallel completely there is no way to do that currently: > Number.parseInt('false', 10) || true
true
> Number.parseInt('0', 10) || true
true Am I missing something? |
@YurySolovyov Please specify '1'. |
If you set the parallel option of TersorPlugin to true, resource usage issues may occur.
This problem is noticeable when used on containers, and will fail to fork when the number of CPU cores on hardware is high and the memory usage allowed for the container is low.
This is due to the fact that the number of CPU cores count - 1 process is generated when the parallel option of TersorPlugin is true.
This patch makes it possible to limit the number of parallelizations in the following way.
How to write to
config/initializers/webpacker.rb
or how to write it before doing
require('@rails/webpacker')
inconfig/webpack/production.js
I'm sorry if you find something strange because I use Google Translate.