-
Notifications
You must be signed in to change notification settings - Fork 245
Expand Circuit Breaker Troubleshooting #4520
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
Changes from 4 commits
4fab972
716ad43
ecfc4db
df1771f
b107d25
8d60b20
66587bf
8809a79
af30eb1
f117e6e
1887f6e
4372723
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ | |
|
|
||
| **Error messages** | ||
|
|
||
| If a request triggers a circuit breaker, {{es}} returns an error with a `429` HTTP status code. | ||
| A circuit breaker trips when it prevents a request from executing in order to protect the node's stability. When a request triggers a circuit breaker, {{es}} returns an error with a `429` HTTP status code. | ||
|
|
||
| ```js | ||
| { | ||
|
|
@@ -45,6 +45,20 @@ | |
| Caused by: org.elasticsearch.common.breaker.CircuitBreakingException: [parent] Data too large, data for [<transport_request>] would be [num/numGB], which is larger than the limit of [num/numGB], usages [request=0/0b, fielddata=num/numKB, in_flight_requests=num/numGB, accounting=num/numGB] | ||
| ``` | ||
|
|
||
| **Check circuit breaker statistics** | ||
|
|
||
| You can use the [node stats API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-stats) to get statistics about the circuit breaker per node. | ||
|
|
||
| ```console | ||
| GET _nodes/stats?filter_path=nodes.*.breakers | ||
| ``` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tanja-milicic an optional good add would be from this request implemented here starting in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! That is definitely much cleaner than current approach.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can add content for a specific 9.x version by tagging it with the applies_to tagging system. You can add an admonition that uses the tags or if you're adding more information than would fit a note, you can add a new section and tag that section. When you add the tags, you don't have to worry if a version's been released or not (for example, you don't have to wait for 9.3 to go out) -- the docs system will take care of that and adjust the way it displays the tagged content.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to go ahead and add the 9.3-specific content, I'll help you add the correct tags to it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Would something like this work? af30eb1 - I have used {applies_to}
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I see! I think in this situation, the easiest option is to use an applies_to switch. The result would look like different tabs for your different versions: Here's the syntax I used: ::::{applies-switch} :::{applies-item} { "stack": "ga" } GET _nodes/stats?filter_path=nodes.*.breakers::: :::{applies-item} { "stack": "ga 9.3" } GET /_cat/circuit_breaker/::: ::::
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I can just push this commit to your branch if you don't mind? Might be a bit easier 😅
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Tanja's off now for the day but if I may vote, please go ahead. However FWIW, v9.3.0 is future release today but likely by the time this PR merges will be live. Or we can merge without my FR as is & then add this in a couple weeks. But in a couple weeks, the same question will need answered that <9.3.0 has to use the Node Stats API and ≥9.3.0 can use the CAT version. How could we do that without tabs but still mark the version differences?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed the tabs-related syntax, but now I'm not so sure the tabs work as they would imply the two API calls are mutually exclusive (which they aren't as far as I can tell, because the Node Stats API will still be useable, right? It's not being deprecated or anything?). Let me try just listing the two requests as options with in-line
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done that in 1887f6e. I've listed both options and included descriptions for what each response will provide. Could you please review for accuracy? |
||
|
|
||
| This will show you: | ||
|
stefnestor marked this conversation as resolved.
Outdated
|
||
| - Estimated memory used for the operation. | ||
| - Memmory limit for the circuit breaker. | ||
| - Total number of times the circuit breaker has been triggered and prevented an out of memory error. | ||
|
stefnestor marked this conversation as resolved.
Outdated
|
||
| - And an overhead which is a constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. | ||
|
|
||
| **Check JVM memory usage** | ||
|
|
||
| If you’ve enabled Stack Monitoring, you can view JVM memory usage in {{kib}}. In the main menu, click **Stack Monitoring**. On the Stack Monitoring **Overview** page, click **Nodes**. The **JVM Heap** column lists the current memory usage for each node. | ||
|
|
@@ -79,3 +93,25 @@ | |
| ```console | ||
| POST _cache/clear?fielddata=true | ||
| ``` | ||
|
|
||
| ## Circuit Breaker Types | ||
|
stefnestor marked this conversation as resolved.
Outdated
|
||
|
|
||
| [Circuit breaker types](elasticsearch://reference/elasticsearch/configuration-reference/circuit-breaker-settings.md) are manually defined for known expensive code paths with a sum-up [parent circuit breaker](elasticsearch://reference/elasticsearch/configuration-reference/circuit-breaker-settings.md#parent-circuit-breaker). Breakers need to be resolved per breaker type; common examples: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This content is excellent but I think should remain in the first linked reference page of Circuit Breaker Settings. Although it should be expanded if any of these bullet points are missing?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! I have removed it as most of it is in the Circuit breaker settings page. However, I see that we removed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @tanja-milicic, you can still find it for the 8.13 version of the docs here: https://www.elastic.co/guide/en/elasticsearch/reference/8.13/circuit-breaker.html#accounting-circuit-breaker We're using a different versioning system for 9.x docs (which is the file you're editing now); it's a cumulative docs approach. Do you need to edit the 8.13 docs? I don't think we maintain the docs that far back, but I can ask my colleagues for ideas on how to proceed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! I wanted to check why the section was removed and if we really don't need it anymore. I am not able to find PR that removed it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that would be this PR here. Note that it's located in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right, thank you for explaining it! |
||
|
|
||
| - `accounting`: Lucene segments and their overhead. Commonly indicates need to [force merge](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge) or [fix large shards](elasticsearch://deploy-manage/production-guidance/optimize-performance/size-shards.md). | ||
|
Check failure on line 101 in troubleshoot/elasticsearch/circuit-breaker-errors.md
|
||
|
stefnestor marked this conversation as resolved.
Outdated
|
||
| - `fielddata`: [field data] and [global ordinals] | ||
| - `eql_sequence`: [eql sequences] | ||
| - `request`: API request bodies. Commonly for [Bulk] sizes too large | ||
| - `inflight_requests`: total API network bytes | ||
| - `script`: [scripts] | ||
| - `regex`: [regex] | ||
|
|
||
| **Memory evaluation** | ||
|
|
||
| Circuit breakers may either directly evaluate memory usage estimates or indirectly limit operations that are likely to cause excessive memory consumption. For example, the `script` circuit breaker checks memory indirectly by rate-limiting Painless/Mustache script compilations. However, even with circuit breakers in place, nodes can still encounter out-of-memory (OOM) conditions. This can occur, for example, because: | ||
|
|
||
| - Circuit breaker relies on point-in-time memory usage estimations. | ||
| - Parallel operations may still heap DOS-attack the node even with `parent` circuit breakers. | ||
|
Check notice on line 114 in troubleshoot/elasticsearch/circuit-breaker-errors.md
|
||
| - Certain dynamic operations can quickly consume substantial memory. For example [aggregations](elasticsearch://explore-analyze/query-filter/aggregations.md) and [complex queries](elasticsearch://reference/query-languages/query-dsl/compound-queries). | ||
|
Check failure on line 115 in troubleshoot/elasticsearch/circuit-breaker-errors.md
|
||
|
stefnestor marked this conversation as resolved.
Outdated
|
||
| Circuit breakers protect JVM heap memory, but if OOM occurs due to non-heap memory; for example JVM for complication (code cache) or thread stacks. | ||
|
Check notice on line 116 in troubleshoot/elasticsearch/circuit-breaker-errors.md
|
||
|
stefnestor marked this conversation as resolved.
Outdated
|
||
|
|
||



Uh oh!
There was an error while loading. Please reload this page.