Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Jake Douglas <jakecdouglas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Rainbows! list" <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: Zbatery/Rainbows keepalive problem?
Date: Sat, 27 Nov 2010 21:30:18 -0800	[thread overview]
Message-ID: <AANLkTimPgtZ47OVJtBz5JMtHs8U5wk6=ULMSou_3e18z@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimkvFSjiz60Bm90NQUa0+7-UE7-R35nVwU8LcQi-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sat, Nov 27, 2010 at 1:55 PM, Jake Douglas <jakecdouglas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Sat, Nov 27, 2010 at 12:50 AM, Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> wrote:
>> Jake Douglas <jakecdouglas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> On Wed, Nov 24, 2010 at 2:14 PM, Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> 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 'render'.
>>> 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.  I rarely actually do anything with a full web browser,
>> but I can confirm keepalive works as expected with curl...  Is 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

After some more experimentation, it looks like the browser(s) fail to
close the connection after receiving the responses. Zbatery then waits
until the keepalive_timeout has expired, closes it, and accepts the
next connection. I gave the same application a try using Thin with
keep-alive and everything works fine. I spent a lot of time trying to
identify differences between the two, but the only useful thing I
managed to find is that the browser side never sends a FIN-ACK when
talking to Zbatery. For some reason, the browser doesn't think it's
finished. Any suggestions appreciated.

Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Do not quote signatures (like this one) or top post when replying

  parent reply	other threads:[~2010-11-28  6:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 20:38 Jake Douglas
     [not found] ` <AANLkTimSuK7-ihgCa00D-fot4U-FbZt2diQFndyN4uit-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-24 21:17   ` Eric Wong
     [not found]     ` <20101124211714.GA25256-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-11-24 21:29       ` Jake Douglas
     [not found]         ` <AANLkTi=oKL0Saw9sjf8Lrw-JakmOUKHnM363Qw=6JQO8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-24 22:14           ` Eric Wong
     [not found]             ` <20101124221402.GA28625-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-11-27  4:35               ` Jake Douglas
     [not found]                 ` <AANLkTi=J9cXKj+7Wi5AbL6FvwsqdJeb9UH6e-Yfs05v--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-27  8:50                   ` Eric Wong
     [not found]                     ` <20101127085011.GA8663-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-11-27 21:55                       ` Jake Douglas
     [not found]                         ` <AANLkTimkvFSjiz60Bm90NQUa0+7-UE7-R35nVwU8LcQi-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-28  5:30                           ` Jake Douglas [this message]
     [not found]                             ` <AANLkTimPgtZ47OVJtBz5JMtHs8U5wk6=ULMSou_3e18z-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-28 10:07                               ` Eric Wong
     [not found]                                 ` <20101128100705.GA23779-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-11-28 17:26                                   ` Jake Douglas
     [not found]                                     ` <AANLkTi=bt+cMTYdc+SMi0DJ3ZBB2iV8PryaWPm5-YqC--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-29 21:12                                       ` Eric Wong
     [not found]                                         ` <20101129211236.GA18934-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-11-29 22:45                                           ` Jake Douglas
     [not found]                                             ` <AANLkTimE+t6o1U--N3MP7btZa0xKXEMHnhTTW=8Sn_x0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-07  0:20                                               ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTimPgtZ47OVJtBz5JMtHs8U5wk6=ULMSou_3e18z@mail.gmail.com' \
    --to=jakecdouglas-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).