Is there a thread safe ActiveRecord replacement?

Ezra Zygmuntowicz ez at
Fri Mar 9 20:41:34 EST 2007

On Mar 9, 2007, at 5:01 PM, Magnus Naeslund wrote:

> Ezra Zygmuntowicz wrote:
>> 	There aren't any lightweight ORM's that i know of that would work
>> better here. I have been using the Mysql library directly with a
>> small wrapper and it works much better then AR when you need high
>> concurrency.
> Yes I'm thinking this is the way to go unless there pops up a  
> framework that I can use before I get around to it.
> In the meantime, how about turning off locking around AR?
> I've seen you say that this won't get me any performance gain, but  
> I don't care about that in this context, I'm just worried that one  
> request going bad will lock up the whole app.
>> 	As far as using send_file thats good but realize that mongrel is
>> serving those files still. You would be better off with nginx up
>> front and using nginx's X-Accell_redirect feture . With this way all
>> you woudl do in your merb action is use nginx_send_file. This just
>> sets the header to the path to the file to be server and nginx serves
>> the file fast instead of mongrel doing it.
> I thought that you just passed it on to mongrel, and it immediately  
> issued a sendfile() system call.
> But you're saying it's just a verb and mongrel will do something  
> not-so-fast?
> Small thing: why don't I get replies on my mails through the list,  
> is there some setting for this?
> It's no biggie, but I'm used to getting both the direct mail and  
> also via the mailinglist...
> Regards,
> Magnus


	Ok so I just made the mutex lock a configration option so you can  
turn it on or off as needed.

The mutex will lock by default for the shortest amount of time  
possible where you could make ActiveRecord calls. If you aren't using  
AR then you can turn it off by doing this in your merb.yml:

:use_mutex: false

or you can do it with the merb command line tool

$ merb --mutex off
$ merb --mutex on


-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- ez at
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)

More information about the Merb-devel mailing list