Skip to content
Merged
38 changes: 37 additions & 1 deletion troubleshoot/elasticsearch/circuit-breaker-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Check notice on line 27 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.Wordiness: Consider using 'to' instead of 'in order to'.
Comment thread
stefnestor marked this conversation as resolved.
Outdated

```js
{
Expand All @@ -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
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 9.3.0 users will have a CAT Circuit Breakers API which will make troubleshooting this much faster.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! That is definitely much cleaner than current approach.
How would we add that since it is not available yet? Would it be better to add the change once we have 9.3.0 released?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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}stack: ga 9.3

@yetanothertw yetanothertw Jan 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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:
The tab for 9.0 - 9.2:
image

And the tab for 9.3:
image

Here's the syntax I used:


::::{applies-switch}

:::{applies-item} { "stack": "ga" }
Use the get node statistics API:

GET _nodes/stats?filter_path=nodes.*.breakers

:::

:::{applies-item} { "stack": "ga 9.3" }
Use the get circuit breakers statistics API:

GET /_cat/circuit_breaker/

:::

::::


image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 applies_to syntax.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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:

Check notice on line 56 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.FutureTense: 'will show' might be in future tense. Write in the present tense to describe the state of the product as it is now.
Comment thread
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.
Comment thread
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.
Expand Down Expand Up @@ -79,3 +93,25 @@
```console
POST _cache/clear?fielddata=true
```

## Circuit Breaker Types

Check notice on line 97 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.Capitalization: 'Circuit Breaker Types' should use sentence-style capitalization.
Comment thread
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:

Check notice on line 99 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.Semicolons: Use semicolons judiciously.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 Accounting requests circuit breaker from the docs - it is available up until 8.13 version. I can't find the reason why it was removed. Any idea?

cc @yetanothertw

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 elasticsearch repo (as opposed to the docs-content repo that hosts 9.x content) on the 8.14 branch -- the 8.x content and branching strategy for docs is/was different.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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

View workflow job for this annotation

GitHub Actions / preview / build

'deploy-manage/production-guidance/optimize-performance/size-shards.md' is not a valid link in the 'elasticsearch' cross link index: https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/elastic/elasticsearch/main/links.json
Comment thread
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:

Check notice on line 111 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.WordChoice: Consider using 'can, might' instead of 'may', unless the term is in the UI.

- 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

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.Acronyms: 'DOS' has no definition.

Check notice on line 114 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.WordChoice: Consider using 'can, might' instead of 'may', unless the term is in the UI.
- 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

View workflow job for this annotation

GitHub Actions / preview / build

'reference/query-languages/query-dsl/compound-queries' is not a valid link in the 'elasticsearch' cross link index: https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/elastic/elasticsearch/main/links.json

Check failure on line 115 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / build

'explore-analyze/query-filter/aggregations.md' is not a valid link in the 'elasticsearch' cross link index: https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/elastic/elasticsearch/main/links.json
Comment thread
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

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.Acronyms: 'JVM' has no definition.

Check notice on line 116 in troubleshoot/elasticsearch/circuit-breaker-errors.md

View workflow job for this annotation

GitHub Actions / preview / vale

Elastic.Acronyms: 'JVM' has no definition.
Comment thread
stefnestor marked this conversation as resolved.
Outdated

Loading