unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: "Anton A. Vesnin" <antonvesnin@gmail.com>
Cc: mongrel-unicorn@rubyforge.org
Subject: Re: stop/start workers "by need"
Date: Fri, 29 Oct 2010 10:40:51 -0700	[thread overview]
Message-ID: <20101029174051.GA25861@dcvr.yhbt.net> (raw)
In-Reply-To: <201010291516.31851.antonvesnin@gmail.com>

"Anton A. Vesnin" <antonvesnin@gmail.com> wrote:
> Hello to everybody.
> I making shared hosting for rails and rack applications. For app. server i 
> userd phusion passenger, but after some issues with that, want to migrate to 
> unicorn. 
> 
> Is there any way to make unicorn stop all workers and start them on first 
> request? It'll be really great to have this opportunity. 

Hi Anton, there's no current way to do this.

Unlike Apache/Passenger, Unicorn should only be tuned for backend
requirements, never to actual connected clients.  Unicorn isn't too
different from prefork Apache when serving requests, it's just the
"marketing" for Unicorn focuses _very_ strongly on its limitations :)

On a memory-constrained box, maybe tailing logs or similar and sending
TTIN/TTOU signals to increment/decrement workers as needed can work.  A
smarter version of this would even recognize which endpoints are more/less
expensive and tune the workers accordingly.

A dumb version of this would just be a cronjob that
increments/decrements worker depending on the time of day.  If you're
running batch processes at off hours, maybe the dumb version is all you
need :)

I'm strongly against having this logic in Unicorn itself since apps
behave wildly differently depending on how they're implemented.  And
most deployments I've supported over the years were better off with
fixed/dedicated resources and letting the OS manage things.

> Reply with Cc:, pleace. Thank you.

-- 
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-10-29 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 11:16 stop/start workers "by need" Anton A. Vesnin
2010-10-29 17:40 ` Eric Wong [this message]
2010-10-29 17:55 ` Jamie Wilkinson

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=20101029174051.GA25861@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=antonvesnin@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).