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.0 required=3.0 tests=AWL,MIME_QP_LONG_LINE, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Jake Douglas Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: Zbatery/Rainbows keepalive problem? Date: Sat, 27 Nov 2010 13:55:34 -0800 Message-ID: References: <20101124211714.GA25256@dcvr.yhbt.net> <20101124221402.GA28625@dcvr.yhbt.net> <20101127085011.GA8663@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1290896925 10953 80.91.229.12 (27 Nov 2010 22:28:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 27 Nov 2010 22:28:45 +0000 (UTC) To: "Rainbows! list" Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Sat Nov 27 23:28:40 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GShcY2wko1auY3IST5NXyGvhTUtuJ+f9guI6WIRHhHY=; b=R5H4HSHubOK7khnwj+aHOAfSv4S6KNU7NWIrQfZsLIwb7A7h2CIJUo6MpuMY6Ye+TS GflNy9bWnJGGbz/nsJ7WwYy4Vm6EygoZ5P+UlQ/CZOANoqcg9Bc1An2ql686lIHdtnBd 8c1Nyiq0U9DheghR8OHSmzEZBHxAGiz18ICqw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QZ9VTh9uUB2nxM67KwGkw9L/4Gc+B6pc+1D2f5TpRi/eCjKQgodd31UKy5GA3P4s+5 Wnpv/EVdmctp4fTvzgso4BLMppAkoyYwbqkRdREARf6Ht0aK++pDBZ9lmIUVxNpuAB/Q qCyQPF/ak314pqi2v6JtJTR9O2fBbXbo5B4m8= In-Reply-To: <20101127085011.GA8663-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 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:153 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PMTG3-0001zD-Lg for gclrrg-rainbows-talk@m.gmane.org; Sat, 27 Nov 2010 23:28:39 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 8F9A61858364; Sat, 27 Nov 2010 17:28:38 -0500 (EST) Received: from mail-fx0-f50.google.com (mail-fx0-f50.google.com [209.85.161.50]) by rubyforge.org (Postfix) with ESMTP id 9370818581B2 for ; Sat, 27 Nov 2010 16:55:36 -0500 (EST) Received: by fxm14 with SMTP id 14so2441283fxm.23 for ; Sat, 27 Nov 2010 13:55:36 -0800 (PST) Received: by 10.223.101.131 with SMTP id c3mr3669989fao.95.1290894934274; Sat, 27 Nov 2010 13:55:34 -0800 (PST) Received: by 10.223.105.207 with HTTP; Sat, 27 Nov 2010 13:55:34 -0800 (PST) On Sat, Nov 27, 2010 at 12:50 AM, Eric Wong wrote: > Jake Douglas wrote: >> On Wed, Nov 24, 2010 at 2:14 PM, Eric Wong wrote: >> > >> > The normal Rails "render" path already seems[1] to add Content-Length; >> > are you doing something else to send responses from Rails? >> >> I am not doing anything special to send responses from Rails, only 'rend= er'. >> >> I can see in my browser that keep-alive is set, and Content-Length is >> also set. It looks like the first couple requests finish quickly, and >> then the remaining take an additional 5 seconds each. It seems the >> browser is hanging for the default keep-alive timeout of 5 seconds on >> each request before proceeding. This happens with different browsers. > > Interesting. =A0I rarely actually do anything with a full web browser, > but I can confirm keepalive works as expected with curl... =A0Is there > anything in your error logs such as exceptions being thrown by your > app? > > Can anybody else reproduce this behavior Jake is seeing? > >> Is there additional information I can provide to give better insight >> into why this is happening? > > tcpdump or similar output would be useful, thanks! > > -- > 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 > It looks like the first issue is that by default Rails does not actually use Rack::ContentLength or set the Content-Length itself. The next issue is this bug, where Rack::ContentLength has some conditions that cause it to skip handling of the ActionDispatch::Response object from Rails. (ActionDispatch::Response < Rack::Response) http://rack.lighthouseapp.com/projects/22435/tickets/95-responsefinish-and-= contentlength Fixing and enabling Rack::ContentLength seems to fix the issue for a single request to Rails from curl, but I am still getting the problem in my browser(s). Zbatery logs say that the request finishes quickly but the browser hangs for 5 seconds at a time. It is unclear to me what the cause is. I will try to do some more research and let you know the result. Thanks _______________________________________________ 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