Live: Add configuration for client_queue_max_size (#114225)

Live: add configuration for client_queue_max_size
This commit is contained in:
Gareth
2025-11-20 20:08:26 +09:00
committed by GitHub
parent 6e9a33e712
commit 0efffd9ec8
4 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ func ProvideService(plugCtxProvider *plugincontext.Provider, cfg *setting.Cfg, r
Metrics: centrifuge.MetricsConfig{
MetricsNamespace: "grafana_live",
},
ClientQueueMaxSize: 4194304, // 4MB
ClientQueueMaxSize: cfg.LiveClientQueueMaxSize,
// 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
+8
View File
@@ -480,6 +480,9 @@ type Cfg struct {
// LiveMessageSizeLimit is the maximum size in bytes of Websocket messages
// from clients. Defaults to 64KB.
LiveMessageSizeLimit int
// LiveClientQueueMaxSize is the maximum size in bytes of the client queue
// for Live connections. Defaults to 4MB.
LiveClientQueueMaxSize int
// Grafana.com URL, used for OAuth redirect.
GrafanaComURL string
@@ -2066,6 +2069,11 @@ func (cfg *Cfg) readLiveSettings(iniFile *ini.File) error {
if cfg.LiveMessageSizeLimit < -1 {
return fmt.Errorf("unexpected value %d for [live] message_size_limit", cfg.LiveMaxConnections)
}
cfg.LiveClientQueueMaxSize = section.Key("client_queue_max_size").MustInt(4194304)
if cfg.LiveClientQueueMaxSize <= 0 {
return fmt.Errorf("unexpected value %d for [live] client_queue_max_size", cfg.LiveMaxConnections)
}
cfg.LiveHAEngine = section.Key("ha_engine").MustString("")
switch cfg.LiveHAEngine {
case "", "redis":