We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CONN_MAX_AGE=0 CONN_MAX_AGE=60
https://stackoverflow.com/questions/45158234/every-request-from-a-django-app-increasing-mysql-number-of-connections
CONN_MAX_AGE
debug
https://stackoverflow.com/questions/19937257/what-is-a-good-value-for-conn-max-age-in-django
CONN_MAX_AGE=0
https://www.the5fire.com/reduce-db-conn-with-django-persistent-connection.html
The text was updated successfully, but these errors were encountered:
基于 django 1.11
django 1.11
/django/db/utils.py
django.db.utils.ConnectionHandler#ensure_defaults()
django.db.backends.base.base.BaseDatabaseWrapper#connect()
django.db.backends.base.base.BaseDatabaseWrapper#close_if_unusable_or_obsolete()
django.db.backends.base.base.BaseDatabaseWrapper#close()
django.db.backends.base.base.BaseDatabaseWrapper#_close()
Sorry, something went wrong.
CONN_MAX_AGE = 0
多线程
No branches or pull requests
问题:
fix:
ref:
https://stackoverflow.com/questions/45158234/every-request-from-a-django-app-increasing-mysql-number-of-connections
CONN_MAX_AGE
设置为0, 设置非0值, 容易出问题.debug
模式下, 依然可能出问题, 所以, 依然建议设置为默认0值.https://stackoverflow.com/questions/19937257/what-is-a-good-value-for-conn-max-age-in-django
CONN_MAX_AGE=0
是安全做法, 否则会出现报错.https://www.the5fire.com/reduce-db-conn-with-django-persistent-connection.html
The text was updated successfully, but these errors were encountered: