I have a Flask Application and I am using SQLAlchemy as an ORM. Unfortunately, Im running into the problem that I get the error: "psql: FATAL: remaining connection slots are reserved for non-replication superuser connections".
I have increased the max_connections to 25 but the problem remains. I check the pg_stat_activity and I am seeing that the connections are idling so I kill them which temporarily solves the problem until I hit the wall again.
My question is - How can I start debugging this? I am a bit lost where to look for hints.