-
Notifications
You must be signed in to change notification settings - Fork 25.6k
EQL: [Docs] Add documentation for the CircuitBreaker #74897
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
Conversation
Add documentation for the newly introduced CircuitBreaker, which is used to restrict the memory usage for an EQL sequence query to avoid OutOfMemory exceptions. Follows: elastic#74381
|
Pinging @elastic/es-docs (Team:Docs) |
|
Pinging @elastic/es-ql (Team:QL) |
astefan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Do you think it's worth adding some kind of introduction before the settings? Something around "EQL has a circuit breaker to prevent it using too much memory when running sequence queries.... etc"
astefan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left three suggestions.
docs/reference/eql/eql.asciidoc
Outdated
| implements the sequence matching. When large amounts of data need to be processed, | ||
| and/or a large amount of matched sequences is requested by the user (by setting the | ||
| <<eql-search-api-params-size, size>> query param), the memory occupied by those | ||
| structures could potentially exceed the available memory in the JVM. This would cause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| structures could potentially exceed the available memory in the JVM. This would cause | |
| structures could potentially exceed the available memory of the JVM. This would cause |
docs/reference/eql/eql.asciidoc
Outdated
| needs to keep some structures in memory which are needed by the algorithm which | ||
| implements the sequence matching. When large amounts of data need to be processed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which are needed by the algorithm which implements
Too many whiches?
How about
| needs to keep some structures in memory which are needed by the algorithm which | |
| implements the sequence matching. When large amounts of data need to be processed, | |
| needs to keep some structures in memory that are needed by the algorithm implementing the sequence matching. When large amounts of data need to be processed, |
docs/reference/eql/eql.asciidoc
Outdated
| query, so instead of an `OutOfMemory` exception, a `org.elasticsearch.common.breaker.CircuitBreakingException` | ||
| is thrown, and a descriptive error message is returned to the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the circuit breaker doesn't do its job, it doesn't mean an OOM is thrown. How about the following message?
| query, so instead of an `OutOfMemory` exception, a `org.elasticsearch.common.breaker.CircuitBreakingException` | |
| is thrown, and a descriptive error message is returned to the user. | |
| query. When the breaker is triggered, an `org.elasticsearch.common.breaker.CircuitBreakingException` | |
| is thrown and a descriptive error message is returned to the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm torn between an org...... and a ...CircuitBreakingException :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving out the package name or even Exception (which are developers facing implementation details) is preferred. Just an "error message" or similar is enough. Not all users are developers.
costin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
docs/reference/eql/eql.asciidoc
Outdated
| (<<static-cluster-setting,Static>>) The underlying type of the circuit breaker. | ||
| There are two valid options: `noop` and `memory`. `noop` means the circuit | ||
| breaker does nothing to prevent too much memory usage. `memory` means the | ||
| circuit breaker tracks the memory used by trained models and can potentially |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'used by trained models' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, thx! copy-paste error :(
docs/reference/eql/eql.asciidoc
Outdated
| [[eql-circuit-breaker]] | ||
| === EQL circuit breaker settings | ||
|
|
||
| When a <<eql-sequences, sequence>> query is executed, the node handling the query, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last , looks misplaced.
jrodewig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I left some non-blocking suggestions that you can ignore if wanted.
| When a <<eql-sequences, sequence>> query is executed, the node handling the query | ||
| needs to keep some structures in memory, which are needed by the algorithm | ||
| implementing the sequence matching. When large amounts of data need to be processed, | ||
| and/or a large amount of matched sequences is requested by the user (by setting the | ||
| <<eql-search-api-params-size, size>> query param), the memory occupied by those | ||
| structures could potentially exceed the available memory of the JVM. This would cause | ||
| an `OutOfMemory` exception which would bring down the node. | ||
|
|
||
| To prevent this from happening, a special <<circuit-breaker, circuit breaker>> is used, | ||
| which limits the memory allocation during the execution of a <<eql-sequences, sequence>> | ||
| query. When the breaker is triggered, an `org.elasticsearch.common.breaker.CircuitBreakingException` | ||
| is thrown and a descriptive error message is returned to the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This copy is good, but I wonder if we're over-explaining a bit. I'd consider shortening it:
| When a <<eql-sequences, sequence>> query is executed, the node handling the query | |
| needs to keep some structures in memory, which are needed by the algorithm | |
| implementing the sequence matching. When large amounts of data need to be processed, | |
| and/or a large amount of matched sequences is requested by the user (by setting the | |
| <<eql-search-api-params-size, size>> query param), the memory occupied by those | |
| structures could potentially exceed the available memory of the JVM. This would cause | |
| an `OutOfMemory` exception which would bring down the node. | |
| To prevent this from happening, a special <<circuit-breaker, circuit breaker>> is used, | |
| which limits the memory allocation during the execution of a <<eql-sequences, sequence>> | |
| query. When the breaker is triggered, an `org.elasticsearch.common.breaker.CircuitBreakingException` | |
| is thrown and a descriptive error message is returned to the user. | |
| The EQL circuit breaker limits the amount of memory that sequence queries can | |
| use. The breaker prevents an OutOfMemoryError for queries with a large | |
| <<eql-search-api-params-size,`size`>> or data set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@costin What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave it as is. It didn't strike me as too verbose or too detailed. If the overall style of EQL documentation or that of the circuit breakers in Elasticsearch is more concise/trimmed down, then go with @jrodewig suggestion. Otherwise, my personal opinion is to leave it as is. Circuit breakers are a tricky subject in general imo since the memory calculation algorithm is rather non-obvious to the regular user. Enough information passed on in the docs helps sometimes clearing out the confusion around them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What @astefan wrote.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
Co-authored-by: James Rodewig <[email protected]>
Co-authored-by: James Rodewig <[email protected]>
Add documentation for the newly introduced CircuitBreaker, which is used to restrict the memory usage for an EQL sequence query to avoid OutOfMemory exceptions. Follows: elastic#74381
Add documentation for the newly introduced CircuitBreaker, which is used to restrict the memory usage for an EQL sequence query to avoid OutOfMemory exceptions. Follows: elastic#74381
Add documentation for the newly introduced CircuitBreaker, which is used to restrict the memory usage for an EQL sequence query to avoid OutOfMemory exceptions. Follows: #74381 Co-authored-by: Marios Trivyzas <[email protected]>
Add documentation for the newly introduced CircuitBreaker, which is used to restrict the memory usage for an EQL sequence query to avoid OutOfMemory exceptions. Follows: #74381 Co-authored-by: Marios Trivyzas <[email protected]>
Add documentation for the newly introduced CircuitBreaker, which is
used to restrict the memory usage for an EQL sequence query to avoid
OutOfMemory exceptions.
Follows: #74381