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.7 required=5.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Xavier Noria Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Unicorn and streaming in Rails 3.1 Date: Sat, 25 Jun 2011 18:08:59 +0200 Message-ID: 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 1309018821 6207 80.91.229.12 (25 Jun 2011 16:20:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Jun 2011 16:20:21 +0000 (UTC) To: mongrel-unicorn@rubyforge.org Original-X-From: mongrel-unicorn-bounces@rubyforge.org Sat Jun 25 18:20:17 2011 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org 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:1020 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QaVai-0002fh-P3 for gclrug-mongrel-unicorn@m.gmane.org; Sat, 25 Jun 2011 18:20:17 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 10C6C18583B4; Sat, 25 Jun 2011 12:18:51 -0400 (EDT) Received: from mail-gw0-f50.google.com (mail-gw0-f50.google.com [74.125.83.50]) by rubyforge.org (Postfix) with ESMTP id 901E818583B2 for ; Sat, 25 Jun 2011 12:09:39 -0400 (EDT) Received: by gwj16 with SMTP id 16so2316912gwj.23 for ; Sat, 25 Jun 2011 09:09:39 -0700 (PDT) Received: by 10.236.178.1 with SMTP id e1mr7867105yhm.137.1309018179062; Sat, 25 Jun 2011 09:09:39 -0700 (PDT) Received: by 10.147.182.14 with HTTP; Sat, 25 Jun 2011 09:08:59 -0700 (PDT) Streaming works with Unicorn + Apache. Both with and without deflating. My understanding is that Unicorn + Apache is not a good combination though because Apache does not buffer, and thus Unicorn has no fast client in front. (I don't know which is the ultimate technical reason Unicorn puts such an emphasis on fast clients, but will do some research about it.) I have seen in http://unicorn.bogomips.org/examples/nginx.conf the comment "You normally want nginx to buffer responses to slow clients, even with Rails 3.1 streaming because otherwise a slow client can become a bottleneck of Unicorn." If I understand how this works correctly, nginx buffers the entire response from Unicorn. First filling what's configured in proxy_buffer_size and proxy_buffers, and then going to disk if needed as a last resort. Thus, even if the application streams, I believe the client will receive the chunked response, but only after it has been generated by the application and fully buffered by nginx. Which defeats the purpose of streaming in the use case we have in mind in Rails 3.1, which is to serve HEAD as soon as possible. Is that comment in the example configuration file actually saying that Unicorn with nginx buffering is not broken? I mean, that if your application has some actions with stream enabled and you put it behind this setup, the content will be delivered albeit not streamed? If that is correct. Is it reasonable to send to nginx the header X-Accel-Buffering to disable buffering only for streamed responses? Or is it a very bad idea? If it is a real bad idea, is the recommendation to Unicorn users that they should just ignore this new feature? _______________________________________________ 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