From: Russell Branca <chewbranca@gmail.com>
To: mongrel-unicorn@rubyforge.org
Subject: Forking off the unicorn master process to create a background worker
Date: Tue, 25 May 2010 11:53:02 -0700 [thread overview]
Message-ID: <AANLkTinpzdLFf1bWBMRqDepIYQBKeZWb_mC0n-nlPhzD@mail.gmail.com> (raw)
Hello,
I'm trying to find an efficient way to create a new instance of a
rails application to perform some background tasks without having to
load up the entire rails stack every time, so I figured forking off
the master process would be a good way to go. Now I can easily just
increment the worker count and then send a web request in, but the new
worker would be part of the main worker pool, so in the time between
spawning a new worker and sending the request, another request could
have come in and snagged that worker. Is it possible to create a new
worker and not have it enter the main worker pool so I could access it
directly?
I know this is not your typical use case for unicorn, and you're
probably thinking there is a lot better ways to do this, however, I
currently have a rails framework that powers a handful of standalone
applications on a server with limited resources, and I'm trying to
make a centralized queue that all the applications use, so the queue
needs to be able to spawn a new worker for each of the applications
efficiently, and incrementing/decrementing worker counts in unicorn is
the most efficient way I've found to spawn a new rails instance.
Any help, suggestions or insight into this would be greatly appreciated.
-Russell
_______________________________________________
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
next reply other threads:[~2010-05-25 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 18:53 Russell Branca [this message]
2010-05-26 21:05 ` Forking off the unicorn master process to create a background worker Eric Wong
2010-06-15 17:55 ` Russell Branca
2010-06-15 22:14 ` Eric Wong
2010-06-15 22:51 ` Russell Branca
2010-06-16 0:06 ` 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=AANLkTinpzdLFf1bWBMRqDepIYQBKeZWb_mC0n-nlPhzD@mail.gmail.com \
--to=chewbranca@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).