-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve circuit breaking on aggregations #14046
Comments
When I discussed this with @jpountz we talked about potentially adding this to the constructor of Part of this would be determining the "weight" of a single Thoughts and heap dumps welcome :) |
If anyone is curious about this, I'm working on a branch with it here: master...dakrone:bucket-circuit-breaker |
This adds new circuit breaking with the "request" breaker, which adds circuit breaks based on the number of buckets created during aggregations. It consists of incrementing during AggregatorBase creation This also bumps the REQUEST breaker to 60% of the JVM heap now. The output when circuit breaking an aggregation looks like: ```json { "shard" : 0, "index" : "i", "node" : "a5AvjUn_TKeTNYl0FyBW2g", "reason" : { "type" : "exception", "reason" : "java.util.concurrent.ExecutionException: QueryPhaseExecutionException[Query Failed [Failed to execute main query]]; nested: CircuitBreakingException[[request] Data too large, data for [<agg [otherthings]>] would be larger than limit of [104857600/100mb]];", "caused_by" : { "type" : "execution_exception", "reason" : "QueryPhaseExecutionException[Query Failed [Failed to execute main query]]; nested: CircuitBreakingException[[request] Data too large, data for [<agg [myagg]>] would be larger than limit of [104857600/100mb]];", "caused_by" : { "type" : "circuit_breaking_exception", "reason" : "[request] Data too large, data for [<agg [otherthings]>] would be larger than limit of [104857600/100mb]", "bytes_wanted" : 104860781, "bytes_limit" : 104857600 } } } } ``` Relates to elastic#14046
Closed by #19394 |
Will this circuit breaker prevent me from running aggregation that returns zillion buckets? Like generating histogram on file size metrics with step of 5, which can easily result in trillion buckets. |
@haizaar that's the intention, yes |
Unfortunately circuit breaking on aggregations only catches a small subset of out-of-memory errors. I was talking with @dakrone recently who had the interesting idea to also count how many aggregators we create and use it for circuit-breaking. I think it would be a good heuristic to avoid out-of-memory errors in the deeply-nested aggregation case that we often see.
The text was updated successfully, but these errors were encountered: