#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.