El Martes, 5 de Enero de 2010, Iñaki Baz Castillo escribió:
>   before_fork do |server, worker|
>     `echo "before_fork $$" >> /tmp/kk`
>   end


> And this is the file output:
> 
>   before_fork 3447
>   after_fork  3456
>   before_fork 3454
>   before_fork 3463
>   after_fork  3464
>   after_fork  3472


Hummm, this could be something strange related to how `` works...

If I do the following:

  before_fork do |server, worker|
    `echo "before_fork $$" >> /tmp/kk`
     File.open("/tmp/kk", "a") do |f|
       f.puts "$$=#{$$}"
     end
  end

then I get:

  before_fork 11989
  $$=11977
  before_fork 11994
  $$=11977
  before_fork 12000
  $$=11977

So I'm totally lost. However if I test my databases in "before_fork" then I 
see N number of DB connections (N = workers num).





-- 
Iñaki Baz Castillo <[email protected]>
_______________________________________________
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