One meme about Rails is that Rails can't Scale. Is it known how this meme started? Was there a particular blog post that argued this is the case?
-
2If you can answer the question "how [did] this meme start?" then it's not really a meme :-)James– James04/11/2011 09:55:24Commented Apr 11, 2011 at 9:55
5 Answers 5
I would say that there are real technical issues behind it. The Ruby implementation (at least ruby 1.8) is not designed for concurrency : ruby 1.8 has a global interpretor lock, and it uses green threads instead of OS native threads.
So, for a web application to scale, you have to run multiple ruby interpretors, and make them work together.
Note : I am not into web development, and It's been a long time I haven't used ruby. Maybe ruby 1.9 or JRuby don't have these issues. Maybe the global lock is not a real problem for scaling up.
-
JRuby doesn't have the same problem, but Ruby 1.9 does.dan_waterworth– dan_waterworth04/11/2011 13:00:15Commented Apr 11, 2011 at 13:00
Well, to scale, you need reasonable performance per line of code, right? I'm not talking C++ levels, but ... check out
http://dada.perl.it/shootout/index.html
for example on heapsort
But hey, Ruby is faster than vbscript!
-
5For those wondering, Red = CPU, Green = Memory.Justin– Justin04/11/2011 04:58:15Commented Apr 11, 2011 at 4:58
-
5I'm not a hard-core Rubyist but I bet I can think of the come-back: You can do much more with a single line of Ruby than you can with a single line of C++. Seriously, why is "line of code" a good base unit?James– James04/11/2011 09:04:29Commented Apr 11, 2011 at 9:04
-
6Your mixing up scalability with performance; scalability is ability to increase the performance by throwing hardware at the problem.dan_waterworth– dan_waterworth04/11/2011 12:56:57Commented Apr 11, 2011 at 12:56
-
5My question is, what the heck is up with vpascal?quanticle– quanticle04/11/2011 13:34:33Commented Apr 11, 2011 at 13:34
-
3That's Ruby 1.6.7, which is more than a little outdated.mipadi– mipadi04/11/2011 14:46:17Commented Apr 11, 2011 at 14:46
I think it was because Twitter was driven by Ruby on Rails and around mars-may 2008 they had some significant downtimes which started the meme
-
1They had to switch to scala because of that, too.Mahmoud Hossam– Mahmoud Hossam04/10/2011 06:36:19Commented Apr 10, 2011 at 6:36
-
@Mahmoud Hossam didn't they only swap out performance critical parts to scala and leave the rest as Rails?alternative– alternative04/10/2011 11:51:17Commented Apr 10, 2011 at 11:51
-
@mathepic I think the UI parts are still written in Rails, check their github for more details.Mahmoud Hossam– Mahmoud Hossam04/10/2011 12:02:54Commented Apr 10, 2011 at 12:02
As mentioned, there were several "hot" ror startups that suffered issues scaling. I believe that's where the issue primarily came from.
However, there's been performance issues with ruby/ror in the history prior to those meltdowns.
See: Ruby interpreter leaking memory on long running processes:
http://groups.google.com/group/god-rb/browse_thread/thread/01cca2b7c4a581c2
http://engineering.twitter.com/2011/03/building-faster-ruby-garbage-collector.html
DHH's "rails myths" which documents 400 restarts per day:
http://www.loudthinking.com/posts/31-myth-2-rails-is-expected-to-crash-400-timesday
And of course the infamous rails is a ghetto rant from Zed Shaw.
I'm guessing it has to do with the fact that Rails is based around the Active Record pattern, which is quick and easy to get started with, but can slide into a constant refactoring battle as your app's complexity increases. I think that's why you hear about startups in particular having troubles: they're able to get something working quickly, but as they add features, the complexity grows and that's when the trouble starts.
-
1Speaking from experience creating a Rails application, I will second this. Not just in scaling but Rails in general runs into issues when you need to do more than just reading/writing a single record from a database. If you need some kind of complex business logic, for instance, Rails can hinder you more than it benefits you. It's still a superb framework and a beautiful language, but it's not perfect (not that anything is "perfect" in programming).Wayne Molina– Wayne Molina04/11/2011 13:37:30Commented Apr 11, 2011 at 13:37