Elasticsearch contains multiple circuit breakers used to prevent operations from causing an OutOfMemoryError. Each breaker specifies a limit for how much memory it can use. Additionally, there is a parent-level breaker that specifies the total amount of memory that can be used across all breakers.
These settings can be dynamically updated on a live cluster with the cluster-update-settings API.
The parent-level breaker can be configured with the following settings:
indices.breaker.total.use_real_memory
true
) or only
consider the amount that is reserved by child circuit breakers (false
). Defaults to true
.
indices.breaker.total.limit
indices.breaker.total.use_real_memory
is false
. If indices.breaker.total.use_real_memory
is true
, defaults to 95% of the JVM heap.
The field data circuit breaker allows Elasticsearch to estimate the amount of memory a field will require to be loaded into memory. It can then prevent the field data loading by raising an exception. By default the limit is configured to 40% of the maximum JVM heap. It can be configured with the following parameters:
indices.breaker.fielddata.limit
indices.breaker.fielddata.overhead
The request circuit breaker allows Elasticsearch to prevent per-request data structures (for example, memory used for calculating aggregations during a request) from exceeding a certain amount of memory.
indices.breaker.request.limit
indices.breaker.request.overhead
The in flight requests circuit breaker allows Elasticsearch to limit the memory usage of all currently active incoming requests on transport or HTTP level from exceeding a certain amount of memory on a node. The memory usage is based on the content length of the request itself. This circuit breaker also considers that memory is not only needed for representing the raw request but also as a structured object which is reflected by default overhead.
network.breaker.inflight_requests.limit
network.breaker.inflight_requests.overhead
The accounting circuit breaker allows Elasticsearch to limit the memory usage of things held in memory that are not released when a request is completed. This includes things like the Lucene segment memory.
indices.breaker.accounting.limit
indices.breaker.accounting.overhead
Slightly different than the previous memory-based circuit breaker, the script compilation circuit breaker limits the number of inline script compilations within a period of time.
See the "prefer-parameters" section of the scripting documentation for more information.
script.max_compilations_rate