How To Solve Issues Related to Log – New used memory from field would be larger than configured breaker: ; breaking

Get an Elasticsearch Check-Up

Check if your ES issues are caused from misconfigured settings
(Free 2 min process)

Check-Up

Last update: Feb-20

Elasticsearch Error Guide In Page Navigation (click to jump) :

Troubleshooting Background – start here to get the full picture       
Related Issues – selected resources on related issues  
Log Context – usefull for experts
About Opster – offering a diffrent approach to troubleshoot Elasticsearch

Check Your Elasticsearch Settings for Painfull Mistakes 


Troubleshooting background

To troubleshoot Elasticsearch log “New used memory from field would be larger than configured breaker: ; breaking” it’s important to know common problems related to Elasticsearch concepts: breaker, circuit, memory. See below-detailed explanations complete with common problems, examples and useful tips.

Circuit in Elasticsearch

What it is

Circuit breakers are used to prevent operations from causing an OutOfMemoryError in Elasticsearch. There are many settings related to circuit breakers, and each of those settings can be configured using the cluster update API.

There are many types of circuit breakers, such as parent level circuit breakers, request circuit breakers, field data circuit breakers, script compilation circuit breakers and more. All of these put default limits on the amount of memory/heap size that can be used or set a limit on the rate of some other operations that can be done.

Examples

Limit the amount of memory used by fielddata to use up to 30% of JVM heap:

PUT /_cluster/settings
{
    "persistent" : {
           “indices.breaker.fielddata.limit”: “30%”
    }
}

Putting a limit on the number of dynamic scripts to be compiled in 5 minutes:

PUT /_cluster/settings
{
    "persistent" : {
        “script.max_compilations_rate” : “50/5m”
}
}

Notes and Good Things to Know
  • Script.max_compilations_rate limits the number of scripts that can be compiled in a given time interval, the default is 75 per 5 minutes. If you compile too many unique scripts within a small amount of time, Elasticsearch will reject the new dynamic scripts and throw a circuit_breaking_exception error.
Common Problems:
  • In production you need to limit the amount of heap size used by memory intensive search queries by setting indices.breaker.request.limit to a lower value such as 40%, otherwise this will crash Elasticsearch nodes if the settings are left unbounded or above 70%.
  • Similarly, the nodes can also crash if other circuit breaker limits are not properly configured.
  • In addition, apart from circuit breakers, you will need to limit the number of max search buckets for aggregations as well.

Memory in Elasticsearch

What is it

Memory is one of the most critical resources to monitor in Elasticsearch. Elasticsearch runs on JVM and uses heap memory areas for query cache, request cache, accessing lucene segments and storing fielddata for aggregations and sorting.

Commos problems and important points
  • The most common error that arises in Elasticsearch is OutOfMemory error. This error comes when the node is not able to cope up with the required heap size space. To avoid this, you need to closely monitor the heap utilization and garbage collector performance.
  • As per the most up-to-date best practices you should not allocate more than 50 percent of total RAM to JVM heap size. Starting from Elasticsearch version 5.x onward this can be set using -Xms and -Xmx parameters inside jvm.options configuration file. The defaults are set to 1 GB for both minimum and maximum heap size.
  • The heap size should not set more than 31 GB in any case to avoid the poor garbage collection.


To help troubleshoot related issues we have gathered selected Q&A from the community and issues from Github , please review the following for further information :

1. How can I prevent Elasticsearch from using so much memory? – Stats : ♥ 1.07 K  Ι √ 1

2. Es Breaker Memory Limit      


Log Context

Log ”New used memory from field would be larger than configured breaker: ; breaking” classname is MemoryCircuitBreaker.java
We have extracted the following from Elasticsearch source code to get an in-depth context :

                         new ByteSizeValue(bytes); label; new ByteSizeValue(newUsed);
                        memoryBytesLimit; new ByteSizeValue(memoryBytesLimit);
                        newUsedWithOverhead; new ByteSizeValue(newUsedWithOverhead));
            }
            if (memoryBytesLimit > 0 && newUsedWithOverhead > memoryBytesLimit) {
                logger.warn("New used memory {} [{}] from field [{}] would be larger than configured breaker: {} [{}]; breaking";
                        newUsedWithOverhead; new ByteSizeValue(newUsedWithOverhead); label;
                        memoryBytesLimit; new ByteSizeValue(memoryBytesLimit));
                circuitBreak(label; newUsedWithOverhead);
            }
            // Attempt to set the new used value; but make sure it hasn't changed






About Opster

Incorporating deep knowledge and broad history of Elasticsearch issues. Opster’s solution identifies and predicts root causes of Elasticsearch problems, provides recommendations and can automatically perform various actions to manage, troubleshoot and prevent issues

Learn more: Glossary | Blog| Troubleshooting guides | Error Repository

Need help with any Elasticsearch issue ? Contact Opster

Did this page help you?