[Mongrel] Mongrel and multi apps

Zed Shaw zedshaw at zedshaw.com
Wed Aug 9 14:52:18 EDT 2006

On Wed, 2006-08-09 at 10:18 -0600, Kirk Haines wrote:
> 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.

Yes, also known as the Great Katana Suicide Warning.

The name should probably tell that you shouldn't use it.

Zed A. Shaw
http://www.railsmachine.com/ -- Need Mongrel support?

More information about the Mongrel-users mailing list