From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.mongrel.devel Subject: Re: [ANN] Unicorn: UNIX+localhost/LAN-only Mongrel fork Date: Wed, 11 Feb 2009 16:59:32 -0800 Message-ID: <20090212005932.GB26706@dcvr.yhbt.net> References: <20090211230457.GB22926@dcvr.yhbt.net> <21ee31950902111632y6df95e9h1f9dd642bcc55baf@mail.gmail.com> Reply-To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1234400392 32100 80.91.229.12 (12 Feb 2009 00:59:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2009 00:59:52 +0000 (UTC) To: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Thu Feb 12 02:01:07 2009 Return-path: Envelope-to: gclrmd-mongrel-development@m.gmane.org Content-Disposition: inline In-Reply-To: <21ee31950902111632y6df95e9h1f9dd642bcc55baf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: mongrel-development-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: mongrel-development-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.mongrel.devel:86 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1LXPwq-0003YN-6K for gclrmd-mongrel-development@m.gmane.org; Thu, 12 Feb 2009 02:01:00 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 55BE915B8033; Wed, 11 Feb 2009 19:59:38 -0500 (EST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 7805A15B8026 for ; Wed, 11 Feb 2009 19:59:34 -0500 (EST) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id E36AB1F43E; Thu, 12 Feb 2009 00:59:32 +0000 (UTC) List-Post: Ryan Dahl wrote: > Eric, > > this sounds great. > > what would you think of adding an option to allow the server to > connect to one (or more?) unix pipes for process restart instructions? > i'd love to add a nginx module which notices when a backend is > responding too slowly and can notify Unicorn to restart it. (this is > the killer feature of passenger phusion.) > > a simple protocol where a single byte message encodes the index of the > backend that needs to be restarted would work i think (easy to > multiplex with multiple writer processes) Hi Ryan, Something like this should already be doable via various means Workers already process SIGQUIT to gracefully stop; so I'd rather not reinvent that part even with a very simple protocol. The master process already notices when timeout is expired and sends SIGKILL to workers. I could add a :soft_timeout config and have it send SIGQUIT to workers if a lower timeout is reached. On the other hand, I could see implementing soft_timeout having statistics+heuristics, being URL/action-aware. So IMHO this could be more completely implemented as a separate package that watches the logs via `tail -F`. That way one can define which actions are allowed to take longer without affecting the timeout (connecting to external services for example). As much as I love nginx, I'm really not a fan of adding modules and increasing the complexity of the nginx process. Yeah, I'm pretty firmly on the "cat -v considered harmful" side of the fence :) -- Eric Wong