Hi, I use Mongrel to serve my Rails applications on my server, but how can I serve more than one application with one mongrel server? Thanks. -jec -- Best regards / Salutations. Jean-Eric Cuendet Senior developer / Technical support Riskpro Technologies SA Av. Louis-Ruchonnet 2 CH-1003 Lausanne Switzerland Direct : +41 21 637 0123 Principal : +41 21 637 0110 Fax : +41 21 637 0111 Skype : jec.rptec Web : http://www.rptec.ch --------------------------------------------------------
in a nutshell, you can''t. you''ll need (at least) one instance of mongrel for each app, each running on a different port. what you will want to do is run you mongrel instances proxied behind another server, for example, apache. you also have the option of using mongrel_cluster to load balance if necessary. check out the docs on the mongrel site for more detailed info on proxying and clustering mongrel. Chris On 8/9/06, Jean-Eric Cuendet <jec at rptec.ch> wrote:> Hi, > I use Mongrel to serve my Rails applications on my server, but how can I > serve more than one application with one mongrel server? > Thanks. > -jec > > -- > Best regards / Salutations. > > Jean-Eric Cuendet > Senior developer / Technical support > Riskpro Technologies SA > Av. Louis-Ruchonnet 2 > CH-1003 Lausanne > Switzerland > > Direct : +41 21 637 0123 > Principal : +41 21 637 0110 > Fax : +41 21 637 0111 > Skype : jec.rptec > Web : http://www.rptec.ch > -------------------------------------------------------- > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
On Wed Aug 09, 2006 at 07:38:07AM -0400, Chris Hall wrote:> in a nutshell, you can''t.are you sure you can''t? i mean cant you run like 10 MouseHole/Camping apps off a single mongrel? im guessing youd need to investigate mongrel_rails script..
> are you sure you can''t? i mean cant you run like 10 MouseHole/Camping apps off a single mongrel? im guessing youd need to investigate mongrel_rails script..Rails is not threadsafe, so you can only have 1 process per mongrel. -- Rick Olson http://techno-weenie.net
> 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?
On Aug 9, 2006, at 8:49 AM, carmen 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? > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-usersActionPack and ActiveRecord claim to be thread safe but this is a lie ;) When the whole rails stack is used together it is definitely not thread safe. -Ezra
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
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.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?