I deploy a Rails app using Unicorn. After every deployment and after every tweak I do to the DB_POOL
I see postgres still hold some connections as idle and new changes are very inconsistently making me wondering If is restarting at all the service after every pool change.
I haven't found any documentation regarding this. Is there any similar command to pg_ctl on Heroku?
No, you cannot restart your Postgres database on Heroku. If you have lingering connections, it's likely an app issue. Try in stalling the pg-extras plugin and looking for IDLE
connections:
Also, you can try setting up a custom ActiveRecord connection in your after_fork
block and enabling the connection reaper, which should clean up any lingering dead connections it finds:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With