-
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
Big ram usage #2267
Comments
It looks like you set everything up properly in that repo. Can you post the deploy log to a https://gist.github.com? Edit: If you set this line to Edit: It looks like that limit might be a sales tactic for that platform. |
I don't think @excid3 can do something like this, also because the server is a 2GB server and he doesn't sell servers, but only deploying service! https://gist.github.com/ferdi2005/556e7d9c6b33641ae392bcd5e747929c |
Not sales tactic, just what I've seen with many people's apps. You've got Rails, Passenger/Puma, Postgres, and Redis using RAM and then a new deploy compiling assets all at the same time and you can easily get your webpacker compile killed by the OS. Plus, these VPSes don't have swap for the RAM to bleed into temporarily since they're SSD backed and that'd cause heavy wear on the disk. This is likely because Javascript doesn't get run through babel in the asset pipeline. I don't think it's necessarily something that can be fixed in Webpacker, nor Hatchbox. Just the nature of how the two Javascript pipelines are different. |
Thanks @excid3, but I had no doubt that this is a Webpacker problem, not an Hatchbox one. |
Up-selling like this in the VPS biz is perfectly legit, but crashing the process instead of letting garbage collection do it's thing makes for a bad customer experience.
Surely you can set up the JS heap size limits on the VPS to respect the amount of RAM that the user has available from their plan? As memory consumption approaches the limit, it should spend more time on garbage collection in an effort to free unused memory. For all I know you might already do that, but, from the log, you can see that it cannot get past the Edit: @ferdi2005 I am unsure of how you deploy with Hatchbox, but you can add the argument |
I've not configured anything to crash the process, Ubuntu is killing the process. I also don't have anything in tuning things. It's simply installing node and yarn and running assets:precompile on deploy without any tweaks. I'll do some testing with the |
Quick note: That flag is a nodeJS flag that is passed to V8. If you want to globally add the flag, I have read that you can do something like:
Thanks for clarifying. To be clear, this was not meant to be hostile to yourself, but rather to working with VPSes in general. Any service that reduces that burden is a welcome one 😅. For anyone else who happens upon this, these types of problems are endemic to a) any system that has hard RAM limits and b) single-threaded engines that require garbage collection. |
I recently switched to using Node 12 (which is almost LTS) in production and memory usage halved during asset compilation. |
@inopinatus just did the same as well and so far seeing the same, but only anecdotally atm. I'm just using nodesource's package
Also, in case it might help others... I have a single staging machine that i'm really pushing the limits on, especially in terms of memory pressure. For reference: I'm not sure how I missed this, but I realized I didn't have any swap configured. I added 2G of swap to my EBS volume and now it's a worlds difference. Now, even when compilation pushes my memory utilization over the edge, the system doesn't become entirely crippled. This is just a staging environment, so I'm much happier with a bunch paging/swapping vs hung ssh/failed deploy/etc |
Hi i have updated to node12 but it start eating ram upto 5GB while deploy to production pls help me out. |
Hi ! I'm using node v12 also on OSX latest version. |
We upgraded to node12.13.1 and it's really eating up ram too! If anyone knows what to do, please let use know! |
for info, I fixed my problem with that : #2803 @stomachfat |
If your server has many CPU cores, this support may improve. |
We can't do really do anything I guess, It's more a Webpack issue |
I use Hatchbox to deploy my apps to a 2GB server. Webpacker has a very high usage so the deploy stops because of lack of ram.
There are a very few JS file and with sprockets it compiles successfully without high ram usage.
The text was updated successfully, but these errors were encountered: