From edfac91d05f12d314c754813f9b127a9b635b044 Mon Sep 17 00:00:00 2001 From: Kyle Mulka Date: Tue, 15 Jul 2025 20:13:31 -0400 Subject: [PATCH] Disable persistent database connections for ASGI compatibility Set conn_max_age=0 in database configuration to disable persistent connections, as recommended by Django documentation for ASGI applications. This prevents connection pool exhaustion and resource contention issues when handling many concurrent async connections. --- mysite/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysite/settings.py b/mysite/settings.py index 5e84a8b5..ca90db40 100644 --- a/mysite/settings.py +++ b/mysite/settings.py @@ -83,7 +83,7 @@ 'default': dj_database_url.config( # TODO update this row to your proper connection string default='postgresql://postgres:postgres@localhost:5432/mysite', - conn_max_age=600 + conn_max_age=0 ) }