mirror of
https://github.com/grafana/grafana.git
synced 2026-02-03 20:49:50 -05:00
Live: Add configuration for client_queue_max_size (#114225)
Live: add configuration for client_queue_max_size
This commit is contained in:
parent
6e9a33e712
commit
0efffd9ec8
4 changed files with 17 additions and 1 deletions
|
|
@ -1959,6 +1959,10 @@ max_connections = 100
|
|||
# The limit can be disabled by setting it to -1.
|
||||
message_size_limit = 8388608
|
||||
|
||||
# client_queue_max_size is the maximum size in bytes of the client queue
|
||||
# for Live connections. Defaults to 4MB.
|
||||
client_queue_max_size = 4194304
|
||||
|
||||
# allowed_origins is a comma-separated list of origins that can establish connection with Grafana Live.
|
||||
# If not set then origin will be matched over root_url. Supports wildcard symbol "*".
|
||||
allowed_origins =
|
||||
|
|
|
|||
|
|
@ -1903,6 +1903,10 @@ default_datasource_uid =
|
|||
# ha_prefix is a prefix for keys in the HA engine. It's used to separate keys for different Grafana instances.
|
||||
;ha_prefix =
|
||||
|
||||
# client_queue_max_size is the maximum size in bytes of the client queue
|
||||
# for Live connections. Defaults to 4MB.
|
||||
;client_queue_max_size =
|
||||
|
||||
#################################### Grafana Image Renderer Plugin ##########################
|
||||
[plugin.grafana-image-renderer]
|
||||
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Reference in a new issue