Consider changing defaults for database connections #5802
Labels
good first issue
Issues with this label are good candidates for first-time contributions
help wanted
Issues with this label are ready to start work but are in need of someone to do it
priority/backlog
Issue is approved and in the backlog
Currently we have the following defaults for connections to the database:
db/sql
so it might be good to at least document it as such)This means that any deployments that has some kind of consistent load is going to end up in the situation where connections to the database are being churned. If we end up needing more connections than max idle connections we will need to create a connection, run the query we need to run, and then close it. That doesn't make for very good performance usually.
Having the number of idle connections be somewhat higher if not equal to max open connections ends with less wasted load. That's also what the official documentation recommends for high parallelism apps:
To make sure that the connections are not kept open indefinitely we can adjust ConnMaxIdleTime to some small values, like 10-60s, so the connections are closed if they are not needed anymore, for example during a burst of activity.
The text was updated successfully, but these errors were encountered: