Closed eoinkelly closed 1 year ago
An update on this after living with it for a while:
This technically works every time but it's not always effective. We have still noticed some issues serving traffic on small (t3.medium) EC2 instances while Webpack is compiling.
We have been successful using cpulimit
rather than nice
but we had to compile it ourselves from https://github.com/opsengine/cpulimit to get the version which also limits child processes. That approach is much too niche and the original approach isn't effective so I'm closing this. :shrug:
We sometimes hit an issue where the Webpack compile part of the
assets:precompile
takes enough CPU that it causes response times to go up noticeably.I created a workaround by running
assets:precompile
under a lower CPU priority using nice. I chosenice
becauseassets:precompile
(unlike things like cpulimit)I'm guessing I'm not the only person who has hit this issue so I think it could potentially be useful to have this as an (opt-in, turned on via config) part of this gem.
I am happy to work up a PR if this is something the core team would consider.