#36964: Documentation incorrectly states that persistent connections don't work
with runserver
-------------------------------------+-------------------------------------
Reporter: Adam Sołtysik | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
From https://docs.djangoproject.com/en/5.2/ref/databases/#caveats:
> The development server creates a new thread for each request it handles,
negating the effect of persistent connections. Don’t enable them during
development.
Something here seems to be incorrect. I'm using `'CONN_MAX_AGE': None`
with the development server, and it works as expected. My requests are
significantly faster than with the default setting. When analyzing with
`SELECT * FROM pg_stat_activity WHERE datname = '<dbname>'`, I can see a
single connection created and persisting after the first request, and it
disappears after autoreload.
--
Ticket URL: <https://code.djangoproject.com/ticket/36964>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019cae12bf4e-38a35a68-71ee-4011-a280-e74dec236382-000000%40eu-central-1.amazonses.com.