I currently have a django application, and have a PostgreSQL database. I have researched this error, and have found other answers on Stackoverflow, but none seem to answer my exact question. I am getting this error when a request is made to a server. Note that I am currently running my application locally. A lot of my views contain requests to the database:
django.db.utils.OperationalError: FATAL: remaining connection slots are reserved for non-replication superuser connections
Here are the configurations for the database that are in my settings.py file:
Any help would be greatly appreciated!
DATABASES = {
'default': {
'ENGINE': 'django_postgrespool',
'NAME': 'database',
'USER': 'user',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '5432',
'CONN_MAX_AGE': 0,
}
}
You have a connection leak somewhere.
Unless you changed the default settings, you get that message when you try to establish the 98th database connection.
You have to close the connections you don't need any more.
As with all resource leaks, increasing the limit won't hurt, it just buys you time until you hit the ceiling. Plug the hole!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With