From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=-0.0 required=5.0 tests=AWL,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id EF0041F438 for ; Mon, 29 Oct 2012 21:07:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 586992E076; Mon, 29 Oct 2012 21:07:30 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by rubyforge.org (Postfix) with ESMTP id 74F002E075 for ; Mon, 29 Oct 2012 21:07:24 +0000 (UTC) Received: by mail-qa0-f43.google.com with SMTP id k1so2052370qaf.2 for ; Mon, 29 Oct 2012 14:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=R4npIMtjO9DD/+GoG7VU9mz/7rln7lAeG8wRnkPYY1U=; b=hDfUu34ABxbaicqrkVs6770lPj5Bd2qM30zDdDY4nNfm9yNL5lR3Z8ro+e59mfkFp3 sVbwQm4b3iIQsUA3BbYUf+Kh6BRgY/novsvlIwXjgQyXd4HfDwJXlCRWE+WTa+H29C+4 WBB9hnD7sWkwuLJkFYOGa2NZKKV+zGaw8qSozQFsP3NxIBx4Xqw24lnJoQ//MAnNVERo jlp4PolxAWxmQf8VXGsGXAL5kYVOu/zU+7TTOT6j7F8hhOytzXBfLtt+7EAbQoOt8Ihh 0UQczWiLlSWCDtvh97HEkXIcXo+qV13NmDiffaBw3wj4NtcpMKYV6OxcKJ9SD7bAfojJ Rsfw== Received: by 10.224.52.200 with SMTP id j8mr15148137qag.95.1351544844008; Mon, 29 Oct 2012 14:07:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.14.35 with HTTP; Mon, 29 Oct 2012 14:06:43 -0700 (PDT) In-Reply-To: <20121029194101.GA10907@dcvr.yhbt.net> References: <20121029184549.GA9690@dcvr.yhbt.net> <20121029194101.GA10907@dcvr.yhbt.net> From: Hongli Lai Date: Mon, 29 Oct 2012 22:06:43 +0100 X-Google-Sender-Auth: AZeeAERYSV_aKTGJjZ9MVbpGNfs Message-ID: Subject: Re: Combating nginx 499 HTTP responses during flash traffic scenario To: unicorn list 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org On Mon, Oct 29, 2012 at 8:41 PM, Eric Wong wrote: > I'm not sure, Tom can investigate further. > > I do recall haproxy having more intelligent load distribution than > nginx, so it can send requests to less-busy machines, at least. It is correct that HAProxy can do more intelligent load distribution. The "maxconn 1" feature in HAProxy is a bit like global queuing in Phusion Passenger, or the kernel socket queuing that Unicorn relies on. Phusion Passenger sends the request to the first worker that becomes available, and the kernel passes the connection to the first Unicorn instance that accept()s the socket. Nginx's proxy_module passes requests immediately and only does round robin. So to solve this problem we need to add 2 features to the layer that manages the queue: 1. It must be able to detect an early disconnect. 2. It must be able to remove a client from the queue. The kernel obviously can't do this, but I'm very curious as to whether HAProxy supports these two things. I also think it shouldn't be too hard to implement this in Phusion Passenger 4's new architecture. -- Phusion | Ruby & Rails deployment, scaling and tuning solutions Web: http://www.phusion.nl/ E-mail: info@phusion.nl Chamber of commerce no: 08173483 (The Netherlands) _______________________________________________ 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