'before_fork' is executed in parallel by two processes ¿?

Iñaki Baz Castillo ibc at aliax.net
Tue Jan 5 17:49:43 EST 2010

El Martes, 5 de Enero de 2010, Eric Wong escribió:
> > 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).
> How are you testing the database?  `` or via Ruby code?

I use Ruby Sequel ORM.
I've also added the following code to before_fork:

  File.open("/tmp/lalala", "ab") do |f|
    f.puts "My PID is #{$$}"

I confirm that there are two lines printed in that file when Unicorn starts 
(being 2 the number of workers). Is it the expected behavior?


Iñaki Baz Castillo <ibc at aliax.net>

More information about the mongrel-unicorn mailing list