Is there a way to restart postgres on Heroku?

I am deploying a Rails application using Unicorn. After each deployment and after each configuration that I do with DB_POOL , I see that postgres still keeps some connections as idle, and the new changes very elusively make me wonder if restarting on all services after each pool change.

I have not found any documentation regarding this. Is there a similar command for pg_ctl on Heroku?

+6
source share
1 answer

No, you cannot restart your Postgres database on Heroku. If you have lingering connections, there is probably a problem with the application. Try blocking the pg-extras plugin and find the IDLE connections:

In addition, you can try to configure a custom ActiveRecord connection in your after_fork block and enable a connection repeater that should clear any lingering dead connections that it finds:

+4
source

Source: https://habr.com/ru/post/948903/


All Articles