Hacker News new | ask | show | jobs
by tyler 5525 days ago
"Since Rails is not threadsafe, typically several processes will run in parallel on a machine, behind a threaded Web server such as Apache or nginx."

This is incorrect. Rails 3 (and 2.3) are thread-safe. They typically run in multiple processes because of Ruby's GIL.

1 comments

It has a threadsafe mode. It is disabled by default and to my knowledge hardly anyone uses it because you would need to audit all your dependencies to make sure they were threadsafe as well.
So, what the "thread-safe mode" does is enable threads in Rails. (i.e. one thread per request.) To my knowledge, it does not switch out thread-unsafe code for thread-safe code.

Moreover, it's irrelevant. As I mentioned, this is unrelated to why Rails apps are typically run as multiple processes.

As with Twitter, I don't think Rails, nor Ruby, is the issue. Whatever you do with a framework, or a language, is mostly your fault. Ruby on Rails can only be as good as the people use it are, and while I realise the Rails aggressive marketing gives people the impression that RoR is a bullet-proof solution, it isn't, and shouldn't be blamed if a developer doesn't understand the tools he's using.