Unicorn on shared apps platform

Hongli Lai hongli at phusion.nl
Tue Feb 26 15:36:23 UTC 2013

On Tue, Feb 26, 2013 at 4:08 PM, Amol Dev <devamol at yahoo.com> wrote:
> We are hosting multiple Rails applications on same server and using Passenger + Apache. I can see Unicorn be useful for seamless deploys, few questions running it on Rails platform with 50+ rails apps:
> a) How does unicorn scale if app is known to be slow with long running quieres to database? Is there a way to a have master worker spin up new workers aka dynamic workers?

Unicorn is designed for short-running requests. Long-running requests
are best taken care of with app servers designed for that purpose, for
example Rainbows! or Phusion Passenger Enterprise 4. Both app servers
can be used in combination with Apache or Nginx. Rainbows! is designed
for a reverse proxy setup while Phusion Passenger Enterprise 4 can
also integrate with the web server.

As far as I know only Phusion Passenger supports dynamic workers.
Unicorn and Rainbows! are both designed for a static number of
workers. Unicorn and Rainbows! allow modifying the number of workers
during runtime through signals, but not automatically according to
traffic as is done by Phusion Passenger.

> b) Can Unicorn be configured to start with zero worker and master spawning first worker as first request comes in? Very useful to stack multiple apps that are not used all the time.

No, because it does not support spawning processes based on traffic.
As far as I know only Phusion Passenger does this.

> c) Unicorn for zero lost connection (no downtime during deploy and changes) needs new workers spinned up before old workers are sent USR2 signal, does this not mean that one has to provision double memory for servers?

Yes it does. Although it's possible to change this behavior through a
script that sends signals in a certain order.

Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: info at phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

More information about the mongrel-unicorn mailing list