Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
disconnect from connection pool before forking still relevant? #1001
I found this buried in the readme:
I've never seen this recommendation mentioned in any discussions elsewhere, and the configuration is not included in puma's own heroku plugin https://github.com/puma/puma-heroku/blob/master/lib/puma/plugin/heroku.rb
Is the recommendation still relevant? If so, should it go into the heroku plugin? (I can do a PR)
Interesting. I guess disconnecting before forking has the same effect as manually connecting after the fork. I prefer that method otherwise if there's a weird race condition where you've done a query in a separate thread or something you might accidentally create another connection maybe?
I don't see adding it as a bad thing, however I also don't entirely think it's necessary. The
Actually, re-read that comment and I think we should be doing it. It's about connection leaks. Right now you might be left with X connections to the database open that you'll never use for each dyno. Not a big deal for a few dynos but if you've got a lot of them connections in PG aren't free. We should probably add it. Can you send a patch to put it in the plugin @jjb ?