Forums

Postgresql down?

My site doesn't work anymore:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: sorry, too many clients already

https://rencontre.swingsy.fr/

Make sure that your code is not leaving connections open otherwise that will continue to happen. If you're sure that your code is not holding connections open unnecessarily then look here: http://help.pythonanywhere.com/pages/PostgresConnections/

Hey,

I still have issues with that. I use sqlalchemy inside my main app (it closes the connection automatically) and it has 30 visits per day. I have 4 scripts that run once a day during the night. It's why I have difficulties to understand how I can have a problem accessing my database from the console or Klipfolio.com but the website works.

At the moment, the console says "psql: FATAL: sorry, too many clients already Console closed."

I've tried to use "alter system set max_connections = 200" but it doesn't change anything.

It says on Klipfolio:

Unable to connect to database jdbc:postgresql://localhost:41270/swingsy: FATAL: sorry, too many clients already

Perhaps you SQLAlchemy connection pool is opening more connections than it needs to and so has a bunch of connections open that it does not need. The discussion in this StackOverflow post has some ways that you can investigate what is holding connections open.