Search code examples
ruby-on-railsapachememory-managementpassengerruby-enterprise-edition

RoR: From Ruby to Enterprise Ruby Edition (no memory savings?)


I have just tried to switch to Ruby Enterprise Edition, as described here: http://www.rubyenterpriseedition.com/download.html (case: Ubuntu).

REE promises about 30% memory savings, but in my case, I still have 3 ruby instances around 100MB each - just like before (and I think this is way too much for an almost idle server...).

So I suspect the "old" ruby is still being used, but I'm not sure. What I've changed in the Apache config file, after the REE installation (following Passenger's instructions) are some paths:

PREVIOUSLY:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4
PassengerRuby /usr/bin/ruby1.8

NEW, with REE:

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14
PassengerRuby /usr/local/bin/ruby

Do I need to do anything else (modify some other paths, for example)? If so, what and how?

Thank you for your help!
Tom


Solution

  • When people refer to the memory savings of REE compared to other interpreters, they're referring to figures which have been generated from benchmarks.

    These benchmarks are from code which is called many thousands of times in quick succession so that the numbers reflect performance under load. REE often comes out on top because its garbage collection is better, among a number of other things.

    This does not reflect the amount of RAM an app consumes when idle. You'll probably find in most if not all cases that an idle rails app on REE will consume pretty much the same amount of RAM that the same app, on the same server, but using MRI (Matz' Ruby Interpreter - the default) would consume because it is not under the conditions which make REE shine.

    In answer to your question, you can find out what the ruby you've now pointed passenger at is, on your server: /usr/local/bin/ruby -v. If that doesn't report REE, then you've set your paths wrong.