--
Ticket URL: <https://code.djangoproject.com/ticket/32305>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> 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 a bug in one of the django 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.)
New description:
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.)
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32305#comment:1>
* status: new => closed
* resolution: => needsinfo
* component: Core (Other) => Database layer (models, ORM)
* type: Cleanup/optimization => New feature
Comment:
Hi Barney.
> 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.
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/32305#comment:2>
* resolution: needsinfo => wontfix
Comment:
I'll mark this wontfix on the new feature, but happy to review an example
showing the issue (hence the initial needsinfo) – hope that makes sense.
--
Ticket URL: <https://code.djangoproject.com/ticket/32305#comment:3>