Skip to content

Disable persistent database connections for ASGI compatibility #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mulka
Copy link

@mulka mulka commented Jul 16, 2025

Summary

  • Set conn_max_age=0 in database configuration to disable persistent connections
  • This change is recommended by Django documentation for ASGI applications

Background

When using ASGI, persistent connections can cause issues with connection pool exhaustion and resource contention. Each long-lived ASGI connection could hold its own persistent database connection, quickly exhausting the database connection pool.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant