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=1.0 required=3.0 tests=AWL,HK_RANDOM_FROM, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: synchronous controllers taking 6 seconds in Eventmachine config Date: Wed, 15 Sep 2010 11:50:07 -0700 Message-ID: <20100915185007.GA13709@dcvr.yhbt.net> References: <2B157204-E5C6-4F5D-98A9-E2A79F9F9765@christophsturm.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 1284577758 7324 80.91.229.12 (15 Sep 2010 19:09:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Sep 2010 19:09:18 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Sep 15 21:09:17 2010 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Content-Disposition: inline In-Reply-To: <2B157204-E5C6-4F5D-98A9-E2A79F9F9765-Nf+wZpSdgweeYOMve9Zru9BPR1lH4CV8@public.gmane.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:130 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OvxM4-0007Hy-OI for gclrrg-rainbows-talk@m.gmane.org; Wed, 15 Sep 2010 21:09:17 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 0265F1858370 for ; Wed, 15 Sep 2010 15:09:15 -0400 (EDT) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id B3F3F1678316 for ; Wed, 15 Sep 2010 14:50:08 -0400 (EDT) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id F1E5D1F973; Wed, 15 Sep 2010 18:50:07 +0000 (UTC) Christoph Sturm wrote: > hello rainbows friends! > > we use rainbows in eventmachine mode, and it seems there's a bug in > handling of synchronous responses. > > this controller takes 6 seconds: > > def call(env) > Rack::Response.new.finish > end > > this only occurs when i dont set a content length, for example this > controller returns immedately: > > def call > [200, {'Content-Length' => 2}, ['OK']] > end > > it also doesnt seem to be eventmachine specific, if i remove the use > :Eventmachine it also happens. Hi Chris, this is because the client doesn't know when to stop reading the connection otherwise, and waits until the keepalive timeout (5 seconds or so by default). "Content-Length" (or "Transfer-Encoding") is required by the Rack spec, so you need to include it in your app (or use Rack::ContentLength and/or Rack::Chunked middlewares). Starting with Rainbows! 0.97.0, you can set "keepalive_timeout 0" in your Rainbows! config block to disable keepalive across all concurrency models, which lets you violate the Rack spec and get immediate responses. -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying