unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: hukl <hukl@berlin.ccc.de>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Autokill Workers which have grown too big
Date: Fri, 30 Jul 2010 16:11:31 +0200	[thread overview]
Message-ID: <4C52DD93.1090900@berlin.ccc.de> (raw)

Hey,


at Euruko 2010 I saw a presentation where Florian Hanke presented parts 
of a unicorn config which killed workers once they've used up too much 
memory.

The snipped looks like this:

RackResponder = lambda do |env|
   possibly_commit_harakiri ...
end

# Commit Harakiri/Seppuku, kill yourself. #
def possibly_commit_harakiri
   return unless commit_harakiri?
   Process.kill “KILL”, Process.pid
end

Now I couldn't find anything about that RackResponder part on the web 
and was hoping that Florian himself or somebody else on the list could 
clue me in how that works.

Also I'd like to know if there is a way to get the current memory 
footprint of a worker other than something like:

%x(ps -o rss= -p #{Process.pid}).to_i

Kind regards,

John
_______________________________________________
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-07-30 14:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 14:11 hukl [this message]
2010-07-30 22:06 ` Autokill Workers which have grown too big Eric Wong
2010-07-30 22:32 ` Florian Hanke

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=4C52DD93.1090900@berlin.ccc.de \
    --to=hukl@berlin.ccc.de \
    --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).