8000 Clarified connection pool documentation. by ddelange · Pull Request #19442 · django/django · GitHub
[go: up one dir, main page]

Skip to content

Clarified connection pool documentation. #19442

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 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/ref/databases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,26 @@ to ``True`` to use the ``ConnectionPool`` defaults::
},
}

The :setting:`CONN_HEALTH_CHECKS` setting is used to set the ``check`` argument
of :class:`~psycopg:psycopg_pool.ConnectionPool`. The :setting:`CONN_MAX_AGE`
setting should be left unset or set to ``0`` and will be ignored. Configure the
connection lifecycle using the ``max_lifetime`` and ``max_idle`` arguments
instead::

DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
"OPTIONS": {
"pool": {
# these are the default values
"max_lifetime": 3600,
"max_idle": 600,
},
},
},
}

This option requires ``psycopg[pool]`` or :pypi:`psycopg-pool` to be installed
and is ignored with ``psycopg2``.

Expand Down
0