This post originated from an RSS feed registered with Agile Buzz
by Jared Richardson.
Original Post: Benchmarking Rails versus Grails
Feed Title: Jared's Weblog
Feed URL: http://www.jaredrichardson.net/blog/index.rss
Feed Description: Jared's weblog.
The web site was created after the launch of the book "Ship It!" and discusses issues from Continuous Integration to web hosting providers.
The Grails guys posted a quick and dirty benchmark showing that Grails was a lot faster than Rails. I don't think they did anything intentional, but they missed a key point about Rails.
When your application creates a new instance or thread for every new request, it's easy for a server to get overwhelmed. Rails takes another approach. The Rails developers want you to make a conscious decision about how many resources you want an application to have.
So when you deploy a Rails application on Mongrel, you need to decide how many instances are available. This is completely different from the traditional Tomcat model, which looks something more like "spin up threads until the machine stops responding." You can read more about configuring Mongrel on the Mongrel clustering page.
If I've read the page properly, this benchmark is running against a single Mongrel instance, which is the equivalent of creating a Java singleton servlet and testing against it. Of course it's going to be quite slow.
It doesn't sound like the benchmark was intentionally flawed. The single threaded application server is a paradigm shift that many people aren't aware of until they move their Rails application to a production environment. He missed it, and it would be interesting to see how it would perform if he installed a "pack of Mongrels" and ran again.