Exceeded conections to DB (postgres and django-tenants)

20 views
Skip to first unread message

David Emanuel Sandoval

unread,
Feb 23, 2023, 2:13:01 PM2/23/23
to django...@googlegroups.com
Hello everyone!

I hope you can help me with a problem that I have from time to time (I wasn't able to replicate the error). 
The problem is that sometimes the connections to DB exceed the maximum number of allowed connections and I'm not sure why that happens. That causes the app to crash.

I'm using:
- Django 2.3
- Django-tenants
- Python 3.9
- Postgres as database.
- Celery for background tasks

- The app runs on heroku.

The problem occurs when we try to create a new client (creation of the schema in db, running the migrations and other stuff). In the view, after we validate the form we launch a celery task where the actual creation of the Client takes place. And it is at this point where the error occurs.

Apparently there are some connections that block many others and the app tries to create more connections to db, which in turn blocks other processes. Finally the app stops working and crashes.

Any ideas/thoughts about this?
Also, I hope you can understand my english. :))

Thanks in advance.


David Emanuel Sandoval

unread,
Feb 23, 2023, 3:52:55 PM2/23/23
to django...@googlegroups.com
I want to make a correction:
I'm using django 3.2
Reply all
Reply to author
Forward
0 new messages