-
Notifications
You must be signed in to change notification settings - Fork 116
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
Changed the default value for max_open_connections to one. #8
Conversation
…ue is Leq 0 a warning over the python logging system ist emitted. Connections are now checked only against the max_open property.
Why should I change the default? |
Hi,
best |
I don't feel 1 is reasonable value. It's too small for real application. http://golang.org/pkg/database/sql/#DB.SetMaxOpenConns
I disagree. Exception is better than logging.
I really like it. If people misconfigured, libraries should crash ASAP. |
Ok. i will change it to an exception. But still initializing databasepools with unlimited connections is not the way to go. Even in GO. |
…ant for two reasons: First if you have a software system and you chose to use database pools you should be aware of how many connections may be opened to the database servers. Especially when using micro-services where more than one service accesses the database. Second initializing values with unlimited is useless, because there is no such thing as infinite connections to servers or the like. If the values are not initialized properly a ValueException is raised to indicate that the initialization is wrong.
Additional thoughts to the commit message: |
tornado_mysql/pools.py
Outdated
@@ -14,6 +14,7 @@ | |||
|
|||
DEBUG = False | |||
|
|||
POOLLOGGER = logging.getLogger("Tornado-MySQL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
Our company use this module in production already. |
…nnection pools. This change is not backwards compatible. The reason for this is, that the default initialization is not useful.
If the value is Leq 0 an error over the python logging system ist emitted. This can be used to catch failures over network logging and custom defined handlers.
Connections are now checked only against the max_open property.