olegz
July 30, 2018, 8:44pm
1
Using Grafana Cloud Free. Have set up a dashboard and a data source is PostgreSQl hosted on elephantsql.com . Service limits a user to have 5 ocnnections at the same time, but grafana keeps creating connections without closing it if autorefresh ON or if I refresh very fast:
And after some time I get next error message:
The number of connections is set to 10 for sql datasources in grafana. But this number is not configurable:
queryEndpoint.engine = engine
return &queryEndpoint, nil
}
}
engine, err := NewXormEngine(config.DriverName, config.ConnectionString)
if err != nil {
return nil, err
}
engine.SetMaxOpenConns(10)
engine.SetMaxIdleConns(10)
engineCache.versions[config.Datasource.Id] = config.Datasource.Version
engineCache.cache[config.Datasource.Id] = engine
queryEndpoint.engine = engine
return &queryEndpoint, nil
}
const rowLimit = 1000000
olegz
July 31, 2018, 1:19pm
3
Thank you @svenklemm for the answer! What is the purpose to keep a connection open and at the same time open another one?
To query data for different panels in parallel. Or if a panel has multiple queries do those in parallel aswell.
1 Like
v5.2.2 fixes a bug which could cause postgres/mysql/mssql datasources to leak connections, see https://github.com/grafana/grafana/issues/12636 .
Marcus