On 10/18/2012 10:38 AM, Eric Wong wrote:
Petteri Räty <[email protected]> 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 - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

Reply via email to