You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@fjsj the default CONN_MAX_AGE is 0, do you suggest any lower value?
The Heroku docs suggest 500s, the dj-database-url module recommend 600s, some other references recommend 60s.
We need to be careful because If the database terminates idle connections after some time we should set CONN_MAX_AGE to a lower value.
I also found a few issues related to persistent database connections with async workers on Django. If CONN_MAX_AGE != 0 (n or None), Django will reuse the connection (or opens it if it's closed) when needed BUT, apparently it doesn't necessarily close it at the end of requests. This problem doesn't happen with sync gunicorn workers.
https://docs.djangoproject.com/en/3.2/ref/databases/#persistent-database-connections
The text was updated successfully, but these errors were encountered: