Limit configuration database connections (#16512)
When configuration is backed by a database, a separate pool of connections is used for access from the primary database. This change sets sensible config DB connection limits in order to reduce database resource usage at scale.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d2576635cc
Коммит
ab7c92a28b
@@ -47,6 +47,9 @@ func NewDatabaseStore(dsn string) (ds *DatabaseStore, err error) {
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to connect to %s database", driverName)
|
||||
}
|
||||
// Set conservative connection configuration for configuration database.
|
||||
db.SetMaxIdleConns(0)
|
||||
db.SetMaxOpenConns(2)
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user