unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* zero downtime deploys
@ 2009-11-13 22:54 Suraj Kurapati
  2009-11-13 23:12 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Suraj Kurapati @ 2009-11-13 22:54 UTC (permalink / raw)
  To: unicorn list

Hello,

I tried using preload_app with the "zero downtime deploys" trick of
sending SIGQUIT to the old master in before_fork(), as described in:

  http://unicorn.bogomips.org/Unicorn/Configurator.html
  http://github.com/blog/517-unicorn

This significantly reduced, but did not eliminate, the transition time
when the new workers take over (step #2 below):

1. old master (and its workers) is killed in before_fork()
2. workers re-establish DB connections in after_fork()
3. workers are ready to work, at the bottom of after_fork()

Why do we kill the old master in before_fork() when the new workers
are really ready to work much later?  Shouldn't we kill the old master
at the *bottom* of after_fork() --- when the new workers are really
ready to work?

Thanks for your consideration.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zero downtime deploys
  2009-11-13 22:54 zero downtime deploys Suraj Kurapati
@ 2009-11-13 23:12 ` Eric Wong
  2009-11-13 23:25   ` Suraj Kurapati
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2009-11-13 23:12 UTC (permalink / raw)
  To: unicorn list

Suraj Kurapati <sunaku@gmail.com> wrote:
> Hello,
> 
> I tried using preload_app with the "zero downtime deploys" trick of
> sending SIGQUIT to the old master in before_fork(), as described in:
> 
>   http://unicorn.bogomips.org/Unicorn/Configurator.html
>   http://github.com/blog/517-unicorn
> 
> This significantly reduced, but did not eliminate, the transition time
> when the new workers take over (step #2 below):
> 
> 1. old master (and its workers) is killed in before_fork()
> 2. workers re-establish DB connections in after_fork()
> 3. workers are ready to work, at the bottom of after_fork()
> 
> Why do we kill the old master in before_fork() when the new workers
> are really ready to work much later?  Shouldn't we kill the old master
> at the *bottom* of after_fork() --- when the new workers are really
> ready to work?

Hi Suraj,

It depends on your setup, mainly memory constraints.  I know some
deployments run very close to the memory limit of the box and those
examples are geared for that.  We should clarify that in the
documentation.  I also know some setups that always startup with
worker_processes=1 and then SIGTTIN through an external script
gradually.

Obviously I would always try to avoid maintenance during peak traffic
because performance inevitably suffers somewhat (and human error is
always possible :)

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zero downtime deploys
  2009-11-13 23:12 ` Eric Wong
@ 2009-11-13 23:25   ` Suraj Kurapati
  0 siblings, 0 replies; 3+ messages in thread
From: Suraj Kurapati @ 2009-11-13 23:25 UTC (permalink / raw)
  To: unicorn list

On Fri, Nov 13, 2009 at 3:12 PM, Eric Wong <normalperson@yhbt.net> wrote:
> Suraj Kurapati <sunaku@gmail.com> wrote:
>> Why do we kill the old master in before_fork() when the new workers
>> are really ready to work much later?
>
> It depends on your setup, mainly memory constraints.  I know some
> deployments run very close to the memory limit of the box and those
> examples are geared for that.

Ah, that makes more sense.  Thanks.
_______________________________________________
mongrel-unicorn mailing list
mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-13 23:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-13 22:54 zero downtime deploys Suraj Kurapati
2009-11-13 23:12 ` Eric Wong
2009-11-13 23:25   ` Suraj Kurapati

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).