Skip to content

Commit 5bba16f

Browse files
mergify[bot]faec
andauthored
Prevent 'thundering herd' issue with the scale preset (#42410)
Add backoff settings to the `scale` performance preset, as described in elastic/elastic-agent#4469, to reduce load on large deployments. (cherry picked from commit 5fcc26b) Co-authored-by: Fae Charlton <fae.charlton@elastic.co>
1 parent 16c7ebd commit 5bba16f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

libbeat/outputs/elasticsearch/config_presets.go

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ var presetConfigs = map[string]*config.C{
6363
"queue.mem.flush.timeout": 20 * time.Second,
6464
"compression_level": 1,
6565
"idle_connection_timeout": 1 * time.Second,
66+
"backoff.init": 5 * time.Second,
67+
"backoff.max": 300 * time.Second,
6668
}),
6769
presetLatency: config.MustNewConfigFrom(map[string]interface{}{
6870
"bulk_max_size": 50,

libbeat/outputs/elasticsearch/docs/elasticsearch.asciidoc

+16-1
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,8 @@ Setting `bulk_max_size` to values less than or equal to 0 disables the
680680
splitting of batches. When splitting is disabled, the queue decides on the
681681
number of events to be contained in a batch.
682682

683+
684+
[[backoff-init-option]]
683685
===== `backoff.init`
684686

685687
The number of seconds to wait before trying to reconnect to Elasticsearch after
@@ -689,6 +691,7 @@ to `backoff.max`. After a successful connection, the backoff timer is reset. The
689691
default is `1s`.
690692

691693

694+
[[backoff-max-option]]
692695
===== `backoff.max`
693696

694697
The maximum number of seconds to wait before attempting to connect to
@@ -774,7 +777,7 @@ output.elasticsearch:
774777
preset: balanced
775778
------------------------------------------------------------------------------
776779

777-
Performance presets apply a set of configuration overrides based on a desired performance goal. If set, a performance preset will override other configuration flags to match the recommended settings for that preset. Valid options are:
780+
Performance presets apply a set of configuration overrides based on a desired performance goal. If set, a performance preset will override other configuration flags to match the recommended settings for that preset. If a preset doesn't set a value for a particular field, the user-specified value will be used if present, otherwise the default. Valid options are:
778781
* `balanced`: good starting point for general efficiency
779782
* `throughput`: good for high data volumes, may increase cpu and memory requirements
780783
* `scale`: reduces ambient resource use in large low-throughput deployments
@@ -830,6 +833,18 @@ Presets represent current recommendations based on the intended goal; their effe
830833
|`15s`
831834
|`1s`
832835
|`60s`
836+
837+
|<<backoff-init-option,`backoff.init`>>
838+
|none
839+
|none
840+
|`5s`
841+
|none
842+
843+
|<<backoff-max-option,`backoff.max`>>
844+
|none
845+
|none
846+
|`300s`
847+
|none
833848
|===
834849

835850
[[es-apis]]

0 commit comments

Comments
 (0)