Hello,
I am developping a live Grafana backend datasource plugin.
This plugin creates several streams. Here is a schema of my use case (In the diagram, I represented direct connections, but in reality, they are handled by a Centrifuge node. I hope this does not cause confusion):
In the Datasource::Runstream
function (in my backend plugin go code) I create a websocket client that connects to an application I also develop and which is the data provider.
I noticed that I could not create more than 128 of such connections. I did not find anything in the documentation so I looked directly into the code.
It seems that the only way to overcome this limitation is to modify grafana code. In pkg/services/live/live.go:112:
node, err := centrifuge.New(centrifuge.Config{
LogHandler: handleLog,
LogLevel: centrifuge.LogLevelError,
MetricsNamespace: "grafana_live",
ClientQueueMaxSize: 4194304, // 4MB
// Use reasonably large expiration interval for stream meta key,
// much bigger than maximum HistoryLifetime value in Node config.
// This way stream meta data will expire, in some cases you may want
// to prevent its expiration setting this to zero value.
HistoryMetaTTL: 7 * 24 * time.Hour,
+ // New line here to release number of connections constraint
+ ClientChannelLimit: 100000,
})
However, I could not find a way to configure this parametervia Grafana’s configuration file. The closest parameter live/max_connections
seems to limit the number of connections between grafana backend and frontends.
Is there an official way to configure this limit without modifying Grafana’s source code?
Is this restriction of 128 connections expected, or is it specific to my setup?
Thanks in advance!