Better configuration of RUBY_GC_MALLOC_LIMIT
I used to increase this using my own environment variable, but then I would end up running out of memory on deploys.
===
"Every rails app should have a higher malloc limit. The default is too small, this tiny default means that many Rails apps in the wild are getting zero benefit from the faster "lazy sweep" algorithm implemented in Ruby 1.9.3. Further more, low malloc limits mean that the GC runs way too often. Typical Rails requests will regularly allocate a couple of megs of RAM."
--http://samsaffron.com/archive/2013/11/22/demystifying-the-ruby-gc
I’m going to close this tomorrow to release your votes unless you have a comment on my last note.
-
Adam Becker commented
Thanks Khash. I would still appreciate you guys looking into this and perhaps providing some more-sane defaults or best practices.
At this point, I've actually started using Passenger's Out-of-band GC to combat the issue, and removing the RUBY_GC_MALLOC_LIMIT configuration.
Given that the majority of c66 stacks are running Passenger, and the majority of Rails/Passenger apps' performance will benefit *significantly* from the Out-of-band GC, I might consider setting it up by default on your stacks.
Here's some more info: http://blog.phusion.nl/2013/01/22/phusion-passenger-4-technology-preview-out-of-band-work/
-
AdminCloud 66 (Admin, Cloud 66) commented
It seems using the Environment Variables should be enough to achieve this. Is it not?