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: Logging errors from Unicorn
Date: Fri, 4 Jun 2010 20:06:48 +0000	[thread overview]
Message-ID: <20100604200648.GA6767@dcvr.yhbt.net> (raw)
In-Reply-To: <977C003B-E2CA-48B9-A3E6-C126DB231EB5@nulayer.com>

Peter Kieltyka <peter.kieltyka@nulayer.com> wrote:
> Hey guys,
> 
> I'm running a Rails 3 beta3 application using Ruby 1.9.2-preview3 and
> it has been running fairly well, however every now and then (usually
> when under high load), I see error messages like:
> 
> 2010/06/04 14:34:29 [error] 1884#0: *8844 upstream prematurely closed
> connection while reading response header from upstream, client:
> 119.235.237.93, server: portal.crowdreel.com, request: "GET
> /post/18Vmy HTTP/1.1", upstream:
> "http://unix:/home/app/crowdreel-portal/tmp/sockets/unicorn.sock:/post/18Vmy",
> host: "crowdreel.com"
> 
> ... a lot of these messages.. this is a pretty heavy duty server with
> lots of ram.
> 
> I have a setup similar to what I read up on github's blog as in: nginx
> -> unicorns via a socket upstream.
> 
> My unicorn.rb file looks like:
> 
> --------
> 
> # 16 workers and 1 master
> worker_processes 16
> 
> # Load the app into the master before forking workers for super-fast worker spawn times
> preload_app false
> 
> # Restart any workers that haven't responded in 30 seconds
> timeout 45
> 
> # Listen on a Unix data socket
> listen File.expand_path(File.dirname(__FILE__)+'/../tmp/sockets/unicorn.sock'), :backlog => 2048
> 
> ----------

> I don't preload the app because I start running into annoying issues
> where my workers use the same db connection, so instead I just have
> them load their own instance, its very fast to start up anyways.
> 
> I've read everything I could on this issue and exhausted Google, which
> leaves me to think the only thing left is some incompatibilities with
> 1.9.2. So I was wondering, how can I get logs from unicorn's
> workers/master to know what is happening to these workers, perhaps
> something is segfaulting?

Hi Peter,

Set stderr_path in your unicorn config file so Unicorn can log
its errors to a file.  Otherwise Unicorn will send all errors to
/dev/null when daemonized.

I shall emphasize the importance of stderr_path if you're using the
default logger configuration in the documentation.

Any chance the "/post/18Vmy" request is hitting your timeout?  The only
way you can know is if Unicorn logged its errors.  You might also want
to check your Rails log for exceptions, too, as some uncaught errors
may show up there.

-- 
Eric Wong
_______________________________________________
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:[~2010-06-04 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 19:06 Logging errors from Unicorn Peter Kieltyka
2010-06-04 20:06 ` Eric Wong [this message]
2010-06-04 20:47   ` [PATCH] doc: emphasize the importance of stderr_path Eric Wong
2010-06-07 16:07   ` Logging errors from Unicorn Peter
2010-06-07 16:54     ` 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=20100604200648.GA6767@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).