Multiple rack applications on the same server with unicorn

Hongli Lai hongli at
Fri Sep 30 15:50:33 EDT 2011

On Fri, Sep 30, 2011 at 7:04 PM, John Joseph Bachir
<johnjosephbachir at> wrote:
> If I'm running two rails apps on the same server using Unicorn, I have
> to run two instances of Unicorn, right?
> If so, then here's a place where passenger might win in terms of
> memory use, as the rails code will be loaded into memory twice, right?

If you have two apps then Phusion Passenger also loads Rails into memory twice.
Unless if you're using the 'smart' spawning method (instead of the
default 'smart-lv2' spawning method). The Phusion Passenger manual
explains the difference between these two spawning methods. However
'smart' is practically useless these days because everybody uses
Bundler. It is pretty much impossible nowadays to preload the Rails
framework and sharing it between multiple apps transparently. We're
planning on removing the 'smart' spawning method and only supporting
'smart-lv2' in the future.
In the mean time, if you want to share the same Rails memory between
apps, then you should merge them together into a single app.

Phusion | Ruby & Rails deployment, scaling and tuning solutions

E-mail: info at
Chamber of commerce no: 08173483 (The Netherlands)

More information about the mongrel-unicorn mailing list