From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.6 required=5.0 tests=FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Clifton King Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: synchronous restart Date: Tue, 31 Aug 2010 14:08:39 -0500 Message-ID: References: <9ADECA6F-ED48-467D-8826-2C94BF42B18A@tramchase.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1283281744 3691 80.91.229.12 (31 Aug 2010 19:09:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Aug 2010 19:09:04 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Tue Aug 31 21:09:03 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:content-type; bh=GNfAOvHiCrIyeBoP9xuSdh0o3DbZtdtIMSjWTYhm2Sc=; b=H2hYRT/5ChONQ6fYlhs7o233Rr/p/wKoFoEkt9M1eh6/+DouX7YqeKSoR2dWlGv+SF M7eXfxhspaiqy3GgB2QeTSBssDOigJxqhLxMIdAdrlPaABiGl7Y0jvCig904OjLsjf0g qkdLLGCEuuk1SR1JUPO4wfMHMP3AM2Kyn65wA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=cTOG2cgR209l8X0xSLURyWIsekDcxcD5VXlqoyxwpiu+hTbWDExfMYMTUMrNZJvjgK vKGus2HTInNTKsnV2PkxKDI6o0UdxRcG0LLRMXNINkleua4h2skGdvB0i+A+SZ9p7Sqt gHlnKOjzr7kjqkPnn461h2Zl0+58ELhwDwLEs= In-Reply-To: <9ADECA6F-ED48-467D-8826-2C94BF42B18A@tramchase.com> X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:694 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OqWCb-0005Ps-2y for gclrug-mongrel-unicorn@m.gmane.org; Tue, 31 Aug 2010 21:09:01 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 714B61858357; Tue, 31 Aug 2010 15:09:00 -0400 (EDT) Received: from mail-fx0-f50.google.com (mail-fx0-f50.google.com [209.85.161.50]) by rubyforge.org (Postfix) with ESMTP id 83D541678316 for ; Tue, 31 Aug 2010 15:08:40 -0400 (EDT) Received: by fxm20 with SMTP id 20so4721692fxm.23 for ; Tue, 31 Aug 2010 12:08:39 -0700 (PDT) Received: by 10.239.190.135 with SMTP id x7mr437596hbh.23.1283281719394; Tue, 31 Aug 2010 12:08:39 -0700 (PDT) Received: by 10.239.148.132 with HTTP; Tue, 31 Aug 2010 12:08:39 -0700 (PDT) Jamie, Here is a sample unicorn config file that automatically sends the old master process a QUIT signal if the new master process successfully boots and starts forking (which is what I assume you are asking about). We get 0 downtime deploys using this method (and changes typically propagate live in 5-10 seconds). If the new master process fails at booting, you can tail the unicorn.stdout/err.log files to see why. http://pastie.org/1129610 Most of that configuration file was from a github blog post about unicorn (you can try googling for it). I also added a section that writes out PID files for workers so you can monitor their memory usage (and send them quit signals when they exceed the limit). We do that via god. Hope that helps, Clifton On Tue, Aug 31, 2010 at 1:30 PM, Jamie Wilkinson wrote: > Has anyone tried to synchronously restart their unicorns, to ensure that things restart OK? > > I imagine I could write a script that sent USR2 and then watched the log for a successful before exiting, but I dream there is something more MAGICAL > > > Yours in mythical web servers, > > -jamie > > _______________________________________________ > Unicorn mailing list - mongrel-unicorn@rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying