kamisama icon indicating copy to clipboard operation
kamisama copied to clipboard

Before & After fork hooks

Open shiroyasha opened this issue 7 years ago • 0 comments

In real applications, we need a way to handle active record connections before & after forking. The master process doesn't need any DB connections.

Without this hook, if you have a rails based background workers, with 10 worker instances, the system will use 11 db connections. 1 for the master process, and 10 for the actual processes.

Example from Unicorn: https://github.com/defunkt/unicorn/blob/master/examples/unicorn.conf.rb#L57

shiroyasha avatar Mar 30 '17 15:03 shiroyasha