You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have the following defaults for connections to the database:
max open connections - 100
max idle connections - 2 (I think we just take this default from 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:
By default an sql.DB keeps two idle connections at any given moment. Raising the limit can avoid frequent reconnects in programs with significant parallelism.
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:
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: