unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Jimmy Soho <jimmy.soho@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Issues with PID file renaming
Date: Tue, 26 Nov 2013 15:55:32 +1100	[thread overview]
Message-ID: <CAHStS5hG=Occ0Zt9k_Gmye=x9ay2fx6tY_Pa5d_KkFWrXDeciw@mail.gmail.com> (raw)
In-Reply-To: <CABHxtY7R8yACnJt0_SntDUA_tBwDucEewjOovtnsCHAveXfAcw@mail.gmail.com>

On Tue, Nov 26, 2013 at 12:42 PM, Michael Fischer <mfischer@zendesk.com> wrote:

> I'd suggest that you monitor Unicorn by issuing a test request to it
> via its listening socket instead.  Ultimately, you're more likely
> concerned about whether Unicorn is serving requests, not whether its
> pid file exists.  (Such a check can also lead to false positives;
> consider what might happen if an admin or the Linux OOM killer sends
> it a SIGKILL, leaving the pid file intact.)

Great suggestion, thanks. I've added that, as shown below, in case
others are interested. Though perhaps not necessary, am still checking
the PID file as well so it will start asap on absence of the pid file.

@Eric: Thanks for that change.

check process unicorn
  with pidfile /srv/app.example.com/shared/pids/unicorn.pid
  group web
  start program = "/etc/init.d/unicorn start"
  stop program = "/etc/init.d/unicorn stop"
  if mem > 300.0 MB for 1 cycles then restart
  if cpu > 50% for 2 cycles then alert
  if cpu > 80% for 3 cycles then restart
  if failed unixsocket /tmp/.unicorn_sock type tcp protocol http
    and request '/ping' hostheader 'app.example.com'
    with timeout 20 seconds for 2 cycles
    then restart


--
Jimmy
_______________________________________________
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-11-26  4:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26  1:00 Issues with PID file renaming Jimmy Soho
2013-11-26  1:20 ` Eric Wong
2013-11-26  1:40   ` Michael Fischer
2013-11-26  2:07     ` Eric Wong
2013-12-10 12:46   ` Petteri Räty
2013-12-10 19:52     ` Eric Wong
2013-12-10 22:44       ` Petteri Räty
2013-12-11 13:54         ` Michael Fischer
2013-12-12 19:15           ` Petteri Räty
2013-12-12 20:51             ` Eric Wong
2013-11-26  1:42 ` Michael Fischer
2013-11-26  4:55   ` Jimmy Soho [this message]

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='CAHStS5hG=Occ0Zt9k_Gmye=x9ay2fx6tY_Pa5d_KkFWrXDeciw@mail.gmail.com' \
    --to=jimmy.soho@gmail.com \
    --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).