1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Warn about persistent connection "feature" in Django 4.0+

Persistent database connections do not work in Django 4.0+ when running under ASGI; this caused a "too many database connections" problem that was difficult for me to find any information on.

Since the ticket (https://code.djangoproject.com/ticket/33497) is marked as a feature and has been open for almost 2 years, I think it would be worth calling this scenario out in the documentation for anyone else who might hit it.
This commit is contained in:
Andrew Egeler 2023-11-29 14:15:46 -05:00 committed by GitHub
parent c9ce764f59
commit b81604f973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,12 @@ database connection at the end of each request. To enable persistent
connections, set :setting:`CONN_MAX_AGE` to a positive integer of seconds. For
unlimited persistent connections, set it to ``None``.
.. warning::
Persistent connections :ticket:`do not work <33497>` when running Django
under ASGI. Setting :setting:`CONN_MAX_AGE` to anything other than ``0``
may cause you to exceed your database connection limit.
Connection management
~~~~~~~~~~~~~~~~~~~~~