Django attempts to support as many features as possible on all database back-ends. However, not all database back-ends are alike, and the Django developers had to make design decisions on which features to support and which assumptions could be made safely.
This file describes some of the features that might be relevant to Django usage. Of course, it is not intended as a replacement for server-specific documentation or reference manuals.
Persistent connections avoid the overhead of re-establishing a connection to the database in each request. They're controlled by the CONN_MAX_AGE
parameter which defines the maximum lifetime of a connection. It can be set independently for each database. The default value is 0, preserving the historical behavior of closing the database connection at the end of each request. To enable persistent connections, set CONN_MAX_AGE
to a positive number of seconds. For unlimited persistent connections, set it to None
.