I have a php app with a postgresql backend, using PDO to interact with the database. It has been up and running for a couple of months without issue but all of a sudden tonight i'm getting a persistent 500 error on page loads that require a database connection and the error.log file for the server shows this:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006]
[7] FATAL: connection limit exceeded for non-superusers'
The user who connects to the database has a rollconnlimit of -1 so this should not be an issue. When I query the pg_stat_activity table, I can't see any connections.
Any idea what would be causing this? I haven't changed any code that would result in more or less database connections.
I am happy to post some code, but not sure what parts of my code to post without guidance on what might be causing the issue.