unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: A barrage of unexplained timeouts
Date: Thu, 22 Aug 2013 04:09:03 +0000	[thread overview]
Message-ID: <20130822040903.GA14870@dcvr.yhbt.net> (raw)
In-Reply-To: <A48E934780B64D9BB79B265E95F84302@gmail.com>

Jimmy Soho <jimmy.soho@gmail.com> wrote:
> fwiw, we experience this too irregularly, about once a week or 2 weeks
> for a few seconds, and sometimes up to a minute or 2 minutes long. for
> no apparent reasons indeed. and at random times.

Wait, based on what you say below, is this happening to unicorn or
nginx?

> my suspicion so far has always been that this is due to bad (wifi)
> networks of clients. what happens when a request is handled
> successfully by rails, but for whatever reason the last bit of the
> response can't be delivered because the receiving end is not consuming
> in a timely fashion?

So nginx is complaining about disconnected clients, not unicorn,
correct?

> If i'm not mistaken i think that rails logs a 200 success message
> before the response is actually send back?

Correct, rails/unicorn won't know if the client disconnected until
nginx breaks the connection to unicorn.

> Is a response send back by rails / unicorn fully buffered by nginx? Or
> is a unicorn worker blocked until the response is confirmed to have
> been successfully received by the client?

nginx fully buffers both requests and responses by default.
Which leads us to...

> Aside: how do you protect your unicorn workers against a barrage of
> client requests that eat the response veeeeeery sloooooooowly?

That's the whole point of using nginx with unicorn.  nginx shields
unicorn from slow clients.
_______________________________________________
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

  reply	other threads:[~2013-08-22  4:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20 14:47 A barrage of unexplained timeouts nick
2013-08-20 16:37 ` Eric Wong
2013-08-20 17:27   ` nick
2013-08-20 17:40     ` Eric Wong
2013-08-20 18:11       ` nick
2013-08-20 18:49         ` Eric Wong
2013-08-20 20:03           ` nick
2013-08-20 20:42             ` Eric Wong
2013-08-20 21:19               ` nick
2013-08-20 21:32                 ` Eric Wong
2013-08-21 13:33                   ` nick
2013-08-22  2:32                     ` Jimmy Soho
2013-08-22  4:09                       ` Eric Wong [this message]
2013-08-22 13:10                         ` nick
2013-08-22 17:05                           ` 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

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

  git send-email \
    --in-reply-to=20130822040903.GA14870@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 public inbox

	https://yhbt.net/unicorn.git/

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).