Skip to content

Commit 8086e43

Browse files
EQL: [Docs] Add documentation for the CircuitBreaker (#74897) (#75018)
Add documentation for the newly introduced CircuitBreaker, which is used to restrict the memory usage for an EQL sequence query to avoid OutOfMemory exceptions. Follows: #74381 Co-authored-by: Marios Trivyzas <[email protected]>
1 parent 4247bef commit 8086e43

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

docs/reference/eql/eql-search-api.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ change the sort order of hits in the response.
293293

294294
include::{es-repo-dir}/search/search.asciidoc[tag=runtime-mappings-def]
295295

296+
[[eql-search-api-params-size]]
296297
`size`::
297298
(Optional, integer or float)
298299
For <<eql-basic-syntax,basic queries>>, the maximum number of matching events to

docs/reference/eql/eql.asciidoc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,45 @@ results by using <<get-async-eql-status-api,get async EQL status API>>.
792792
You can also manually delete saved synchronous searches using the
793793
<<delete-async-eql-search-api,delete async EQL search API>>.
794794

795+
[discrete]
796+
[[eql-circuit-breaker]]
797+
=== EQL circuit breaker settings
798+
799+
When a <<eql-sequences, sequence>> query is executed, the node handling the query
800+
needs to keep some structures in memory, which are needed by the algorithm
801+
implementing the sequence matching. When large amounts of data need to be processed,
802+
and/or a large amount of matched sequences is requested by the user (by setting the
803+
<<eql-search-api-params-size, size>> query param), the memory occupied by those
804+
structures could potentially exceed the available memory of the JVM. This would cause
805+
an `OutOfMemory` exception which would bring down the node.
806+
807+
To prevent this from happening, a special <<circuit-breaker, circuit breaker>> is used,
808+
which limits the memory allocation during the execution of a <<eql-sequences, sequence>>
809+
query. When the breaker is triggered, an `org.elasticsearch.common.breaker.CircuitBreakingException`
810+
is thrown and a descriptive error message is returned to the user.
811+
812+
This <<circuit-breaker, circuit breaker>> can be configured using the following settings:
813+
814+
`breaker.eql_sequence.limit`::
815+
(<<cluster-update-settings,Dynamic>>) The limit for circuit breaker used to restrict
816+
the memory utilisation during the execution of an EQL sequence query. This value is
817+
defined as a percentage of the JVM heap. Defaults to `50%`. If the
818+
<<parent-circuit-breaker,parent circuit breaker>> is set to a value less than `50%`,
819+
this setting uses that value as its default instead.
820+
821+
`breaker.eql_sequence.overhead`::
822+
(<<cluster-update-settings,Dynamic>>) A constant that sequence query memory
823+
estimates are multiplied by to determine a final estimate. Defaults to `1`.
824+
825+
`breaker.eql_sequence.type`::
826+
(<<static-cluster-setting,Static>>) Circuit breaker type. Valid values are:
827+
828+
`memory` (Default):::
829+
The breaker limits memory usage for EQL sequence queries.
830+
831+
`noop`:::
832+
Disables the breaker.
833+
795834
include::syntax.asciidoc[]
796835
include::functions.asciidoc[]
797836
include::pipes.asciidoc[]

0 commit comments

Comments
 (0)