Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before & After fork hooks #4

Open
shiroyasha opened this issue Mar 30, 2017 · 0 comments
Open

Before & After fork hooks #4

shiroyasha opened this issue Mar 30, 2017 · 0 comments

Comments

@shiroyasha
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant