From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: zero downtime deploys
Date: Fri, 13 Nov 2009 23:12:31 +0000 [thread overview]
Message-ID: <20091113231231.GB27461@dcvr.yhbt.net> (raw)
In-Reply-To: <cfbcd2f00911131454sf4e572ap2847067a59b8dc8c@mail.gmail.com>
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
next prev parent reply other threads:[~2009-11-13 23:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 22:54 zero downtime deploys Suraj Kurapati
2009-11-13 23:12 ` Eric Wong [this message]
2009-11-13 23:25 ` Suraj Kurapati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091113231231.GB27461@dcvr.yhbt.net \
--to=normalperson@yhbt.net \
--cc=mongrel-unicorn@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).