Add an option to limit the number of connections to a database
With the introduction of threads in Django 3.0, somehow only changing from Django 2.2.x to Django 3.0 causes the number of connections to build up, with each request a new connection being added.
Probably this pile-up is because of some bug in one of the Django-related packages. However, it would be nice to have a safety feature in Django not to exceed a limit of database connections. It would make the whole system a lot more robust.
(At the moment it is not even worth to switch for some long term users who use a long list of packages along with Django because the db connection buildup has no straightforward solution, yet.)
Change History
(3)
Description: |
modified (diff)
|
Component: |
Core (Other) → Database layer (models, ORM)
|
Resolution: |
→ needsinfo
|
Status: |
new → closed
|
Type: |
Cleanup/optimization → New feature
|
Resolution: |
needsinfo → wontfix
|
Hi Barney.
This is something worth looking at if you can demonstrate it with a minimal project. There really shouldn't be a regression here.
In general I think tracking connections isn't in scope for Django itself. We'd suggest using a connection pool (e.g. PgBouncer) for your database, or similar approaches.