I have two sites that started receiving the too many connections for role error.
The site crashes several times a day with that error and the only thing that helps is the cli heroku pg:killall
The application releases all the connections correctly - it's a very simple and basic application that uses postgres connection pool.
When I look at the open sessions on pgadmin I see multiple connections by something called "yobuko".
As I follow it, it opens more and more connections until it reaches the 20 connections limit and crashes my application.
What is yobuko, who let it into my database, and how can I stop it from killing my site?
With the lack of a better answer - I'll write a script that hunts these connections and kill them every couple of minutes.
I'm using hobby-dev database level that according to this article on heroku should work as long as I accept up to 4 hours downtime per month (that's ok for me)
EDIT: As I had the Yobuko connections, I also started having other connections called "puma: cluster worker XX."
The last sql they run is:
SELECT "oid", "typname" FROM "pg_type" WHERE (("typtype" = 'b') AND
("typname" IN ('hstore')))
Here's a screen shot: