tags:

views:

118

answers:

2

Someone posted something similar here, however I'm curious to which would run faster and save me more memory? I know that Matz as made many enhancements in 1.9 but I also stand behind the decisions the Phusion guys have made as well.

My question is which is the best to run on my VM which only has 265mb of ram?

+1  A: 

Since Rails 3 will be highly optimized for Ruby 1.9, and Ruby 1.9 has MANY similar optimizations that REE has, Ruby 1.9 will likely be very close in memory usage, and faster than REE.

Yehuda talk about Rails 3:

http://railsonedge.blogspot.com/2009/03/yehuda-katz-talks-about-rails-30.html
http://www.oreillynet.com/pub/e/1338

Tiny Google Group discussion about REE for Ruby 1.9

http://groups.google.com/group/emm-ruby/browse_thread/thread/b5ab0f02c3faac7e#

btelles
I wish Matz would merge some of the REE stuff into the upstream, especially the garbage collector.
Joseph Silvashy
+2  A: 

The 1.8.7 EE would be a safer bet right now. The main problem with Ruby apps is the distinct inability to share memory (the copy-on-write issue) and fixing that is the main aim of EE.

I manage 8 different sites, all running versions of our product running on a mix of Rails, Merb, Rack and Thin on all running on plain old Ruby 1.8.7. For a small Rails application, 256Mb would be ok.

You can see from below that our application is comprised of 6 processes; Rails (2) and Merb (4). The Rails processes (mongrel_rails) are using 104Mb of actual memory each. Our app is reasonably complex with responses of the order of 0.5s so we are looking at being able to handle around 4/5 concurrent users from the 2 Rails processes. Take a look at the shockingly small amount of shared memory to see why EE makes so much sense. I'd expect a much higher shared section with EE.

As they say 'your experience may differ' but there's nothing stopping you from even trying plain old Ruby/Rails and only moving to EE if you need to.

top - 08:57:48 up 128 days, 11:57,  1 user,  load average: 0.07, 0.09, 0.09
Tasks:  76 total,   1 running,  75 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.4%us,  0.1%sy,  0.0%ni, 96.2%id,  0.0%wa,  0.0%hi,  0.0%si,  1.3%st
Mem:   1048796k total,   745840k used,   302956k free,     5192k buffers
Swap:  2097144k total,   634636k used,  1462508k free,   124816k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                 
25875 root      20   0  271m 104m 4616 S    0 10.2 141:07.07 mongrel_rails                                                                            
25872 root      20   0  263m 102m 4648 S    0 10.0 142:11.86 mongrel_rails                                                                            
21089 root      20   0  192m  84m 2436 S    0  8.3   2:52.03 merb                                                                                     
21088 root      20   0  173m  80m 2436 S    0  7.9   2:51.73 merb                                                                                     
21090 root      20   0  179m  74m 2436 S    0  7.3   2:42.83 merb                                                                                     
21086 root      20   0  113m  34m 1660 S   11  3.4   3752:37 merb                                                                                     
 4874 clavis    20   0  122m  31m 3804 S    0  3.1 127:52.87 profile_report                                                                           
 3662 mysql     20   0  368m  22m 3280 S    0  2.2 464:01.81 mysqld             
Chris McCauley
So the two mongrels are running regular ruby 1.8.7 and merb is running EE? So in your case the RSS is about 20% lower with EE if I'm reading this correctly.
Joseph Silvashy
Unfortunately no, the Merb is also on standard 1.8.7. The application has a number of aspects to it, the most time critical are written with Merb because it gave better performance than Rails. If we were doing it again, we'd use Rack via Thin.
Chris McCauley
Updated the answer to make it clear that we aren't using EE
Chris McCauley