mod_ruby vs Mongrel


This post is the result of some hard work and some thinking and a lot of input of other people. The summary is simple: If you care about many concurrent users then mod_ruby is _MUCH_ better then mongrel. Why?

1.  Apache on Unix runs threads _and_ spins out new processes under heavy load (Apache on Windows can not do that. I guess this is just a Windows deficiency but I have nothing to back that up)! If you do not understand what I am talking about read this post from Ben Noordhuis and then read this post from him as well. You can also read the full thread here.

2. Now Mongrel is written in Ruby, not in C. mod_ruby is written in C. As the Wikipedia link says you can configure Apache to run several Mongrel instances. I think this is a lot more complicated then running your App with mod_ruby and then letting Apache take care of your hundreds of requests per second.  Apache in Unix will spin those processes out for you automatically on the fly!

3.  Ruby 1.8.6 is not thread-save. Ruby 1.9 should use Native Kernel-Threads but I first need to find more useful documentation about that. Links are welcome.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s