unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Devin Ben-Hur <dbenhur@whitepages.com>
To: <mongrel-unicorn@rubyforge.org>
Subject: Re: Rack env rack.multiprocess true with single worker
Date: Thu, 18 Oct 2012 11:11:38 -0700	[thread overview]
Message-ID: <5080465A.7080106@whitepages.com> (raw)
In-Reply-To: <20121018173856.GA22944@dcvr.yhbt.net>

On 10/18/2012 10:38 AM, Eric Wong wrote:
> Petteri Räty <betelgeuse@gentoo.org> wrote:
>> On 18.10.2012 10.53, Eric Wong wrote:
>>> Since a single process deployment is a corner-case in production
>>> deployments, I don't think it's worth the effort to jump through hoops
>>> and set rack.multiprocess=false automatically.
>>
>> Do the workers currently know how many others there are? I am trying to
>> understand if you are saying that writing a patch would not be trivial.
>> If it's relative straightforward I might take a stab.
>
> No, workers don't keep track of other workers and it's not easy to
> support this.
>
> The workaround with the DEFAULTS hash is your best option.

I think's Eric's suggested workaround is right, it is a bunch of work to 
make workers track other workers to little benefit; but one could cheat 
and use ps to find sibling processes (children of the worker's parent 
which should be the unicorn master):

def num_workers
   `ps -ef`.
   split("\n").
   map{ |line| line.split(' ',4)[2].to_i }.
   select{ |ppid| ppid == Process.ppid }.size
end
_______________________________________________
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:[~2012-10-18 18:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  6:33 Rack env rack.multiprocess true with single worker Petteri Räty
2012-10-18  7:53 ` Eric Wong
2012-10-18  8:52   ` Petteri Räty
2012-10-18 17:38     ` Eric Wong
2012-10-18 18:11       ` Devin Ben-Hur [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=5080465A.7080106@whitepages.com \
    --to=dbenhur@whitepages.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).