Ship It! LIVEShip It! LIVE
home about services writing contact

We develop, test, and create fine software products, and design creative solutions to your problems.
The development of software is an intrinsically creative process. We are dedicated to improving our mastery of the art.
Links · RSS Feed
Popular Pages

...It would be really nice if, as an industry, we could stop being such a bunch of screwed-up clowns and start living up to our potential. Ship It! is one of the things that could help, if only tho...
-Mike Gunderloy
More practical advice from the pragmatic crew. This is another excellent book from the guys at Pragmatic. In this book Jared and William cover pragmatic project management with down to earth advic...
-Jack D. Herrington
They have gathered together the ‘best bits’ of various styles and methodologies they have been directly involved with, and combined them into a practical approach with the focus on delivering a pro...
-Mitch Wheat

Benchmarking Rails versus Grails (Feb 4)

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.

For a real comparison, I'd try using the Apache load balancer plugin or my personal favorite Pound).

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.

Category: Rails


© 2007 Agile Artisans.