Ruby enterprise edition (REE) on Gentoo failed and some performance experience.
Today I got the chance to give Ruby Enterprise Edition a try. We are currently working with a really fun new environment and you do not get better opportunities to try new stuff as when you have a complete new environment thats not in production. So we gave REE a shoot. When compiling REE with got in trouble really fast and this post is about the quick fix to solve it and some of our early performance results.
The installation of REE is nothing more that unpacking ruby-enterprise-1.8.6-20081205.tar.gz and the run the installer.
tar xzvf ruby-enterprise-1.8.6-20081205.tar.gz
And after that we run
This is when our problems started.
chmod -R g+r,o+r,o-w /opt/ruby-enterprise-1.8.6-20081205/lib/ruby
/opt/ruby-enterprise-1.8.6-20081205/bin/ruby setup.rb --no-ri --no-rdoc
/opt/ruby-enterprise-1.8.6-20081205/bin/ruby: no such file to load -- auto_gem (LoadError)
*** Cannot install RubyGems
This one took some time to find but first I could not understand why auto_gem was not found and also why it tried to load auto_gem when the installation of rubygems is not done.
After a few minutes of thinking and digging i found my environment variable RUBYOPT which was set to -rauto_gem.
This one makes rubygems to autoload when you run something in ruby. I already had this line because i had ruby/rubygems installed before we installed REE. I still want this enviroment but not during the installation so i disabled it by starting the installer like this:
Passing the environment variable before the command just sets it for this command.
If you do want this change permanent some digging in /etc found there is no less that 3 files where this variable is set (depending of shells).
grep -R "RUBYOPT" *
csh.env:setenv RUBYOPT '-rauto_gem'
After changing this variable everything worked as expected!
So far our experience with REE is great. With plain old ruby we where running about 15 passenger (mod_rails) instances and we where using around 1.6GB memory. After The ruby enterprise upgrade we are now using 26 instances with only 1.7GB memory. CPU loads when stressing seems to be 50% less with REE and pages load times are much more stable.
You have to take these measurements with a bit of salt because we only had around an hour of testing but they seem pretty impressive so far.
I will get back with more performance data as we play.