My friend Ezra has been building a new MVC framework for Ruby that I’ve suddenly become quite fond of: it’s called merb, and it’s fast. I like fast—especially now that I’ve built several Rails apps and felt the pressure mount when the app tops at 20 requests per second.

Here’s what Ezra wrote to me when I asked about performance:

Merb is a lot faster then Rails as far as routing and dispatching, filters, action calling. The whole framework is built for speed. I want the time spent during a request to spend very little time in framework code overhead and more time in your own application code. Merb does this very well. A hello world action is about 700req/sec and if you use the event driven mongrel its 1200req/sec for a single merb backend.

So merb can go very fast and has way less overhead then rails does. In rails there is a lot more to do in the framework code before it passes control and your own code gets a chance to run.

And regarding reliability in a production environment:

Merb can handle a lot more concurrent requests on one process than rails can. It can also be run in a fully multi threaded way with no mutex lock if you don’t use activerecord and instead use a thread safe ORM like Sequel. Merb processes in general use about half the ram or less of rails processes and tend to not leak like rails [sometimes] does. One guy is running a file upload type site http://dropboks.com on 4 merbs and he does 500k uploads a day and a ton of downloads. Everything is stored on s3 but proxies and streams thru merb going up and going down.

Just for the record, Ezra is working on this project in his own free time, so send him the positive remarks and please be kind if your performance or reliability isn’t exactly as quoted. As an open source project, you’re free to help out if you find any deficiencies.

As a note to myself and others, here are the gems I’ve installed for merb:

I’ve needed the following for running the tests / specs:

And from what I understand, I will need to use a thread-safe data source such as Sequel to let merb do its fantastic multithreading work:

If you’re into more control over your queries than ActiveRecord gives you, I’d recommend checking Sequel out. It’s code is full of some very neat Ruby as well as a surprising dash of semantic beauty.