2

What if any version of Ruby (2.2.2 or higher) runs in production on Heroku without causing R14 (out of memory) errors for Rails 5 apps? And if so, is "GC tuning" now required to get an app stable in production?

I am creating a new Rails app that will run on Heroku. I'd prefer to use Rails 5 but it requires Ruby 2.2.2+ and that version of Ruby was a disaster for Rails 4 memory usage on Heroku, for example: Does Ruby 2.2 Have Memory Issues on Heroku?

As noted in the S.O. thread linked above, Ruby 2.2.2 caused Rails 4.2 apps to run out of memory with R14 errors in a few hours under low load conditions even with half as many unicorn workers. I and other S.O. posters had to downgrade back to Ruby 2.0 to eliminate the R14 errors.

I have been unable to find any reports online indicating whether there is finally some version of Ruby higher than 2.0 that avoids the R14 issues, and allows Rails 5 apps to run stably on Heroku.

Community
  • 1
  • 1
jpw
  • 18,697
  • 25
  • 111
  • 187
  • 1
    I do have an production app running on Heroku with Rails 5 and Ruby 2.4.0 without R14 issues. But my GC is highly customized. – ErvalhouS Jan 19 '17 at 14:08
  • ErvalhouS, did you have to tune the GC to get it to work reliably, or did it work OK out of the box before the tuning? – jpw Jan 20 '17 at 23:11
  • The only way to avoid huge memory peaks in my application is tuning GC, but that was the case even before Rails 5. It doesn't work reliably without it. – ErvalhouS Jan 25 '17 at 17:54
  • I run mostly without disk swap use, it peaks on some reports pages, where a lot of records are loaded, but GC runs and Swap goes to 0 in few minutes. – ErvalhouS Jan 25 '17 at 18:04
  • Just for the sake of comparison the application receives between 150 - 600 requests/minute on 2x dyno, with stable 70% memory use – ErvalhouS Jan 25 '17 at 18:06

0 Answers0