[Mongrel] Mongrel and multi apps

Kirk Haines wyhaines at gmail.com
Wed Aug 9 12:18:29 EDT 2006

On 8/9/06, carmen <_ at whats-your.name> wrote:
> > Rails is not threadsafe, so you can only have 1 process per mongrel.
> according to actionpack/lib/action_controller/base.rb:239: "Action Pack and Active Record
> are by default thread-safe". plus doesnt mongrel typical run about 4 rails instances? i dont
> see why you couldnt run 8, and have half of them be another app with a URI prefix?

Someone else can speak to Rails and whether it actually is threadsafe or not.

However, you misunderstand Mongrel's handler for Rails.  Take a look
at the source code.  It's clean and easy to read.  The Rails handler
has a single Rails application instance, and it has a mutex that it
uses to limit request processing within Rails to one at a time.  The
use of this guard mutex can be disabled in the handler, if you want to
use Rails multithreaded, but Zed has a strongly worded warning against
doing that in the code.

Kirk Haines

More information about the Mongrel-users mailing list