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

2010-01-05 Thread Iñaki Baz Castillo
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

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

2010-01-05 Thread Iñaki Baz Castillo
El Martes, 5 de Enero de 2010, Iñaki Baz Castillo escribió: 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? Simpler example: - worker_processes 3 before_fork do |server, worker| puts

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

2010-01-05 Thread Iñaki Baz Castillo
El Martes, 5 de Enero de 2010, Eric Wong escribió: Yes, before_fork and after_fork are both called for every worker forked. So if I just want to test a DB connection then I do better wrtitting such code out of before_fork in the config file, right? (at least it's the workaround that works for

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

2010-01-05 Thread Iñaki Baz Castillo
El Miércoles, 6 de Enero de 2010, Eric Wong escribió: Iñaki Baz Castillo i...@aliax.net wrote: El Martes, 5 de Enero de 2010, Eric Wong escribió: Yes, before_fork and after_fork are both called for every worker forked. So if I just want to test a DB connection then I do better