-
Notifications
You must be signed in to change notification settings - Fork 497
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
update controller.md #665
update controller.md #665
Conversation
doc/reference/controllers.md
Outdated
The CircuitBreaker is a finite state machine with three states: `CLOSED`, `OPEN`, and `HALF_OPEN`. When the state is `CLOSED`, requests pass through the CircuitBreaker normally, state transits to `OPEN` if request failure rate or slow request rate reach a configured threshold and the CircuitBreaker short-circuiting all requests in this state. After a configured duration, state transits from `OPEN` to `HALF_OPEN`, in which a limited number of requests are permitted to pass through the CircuitBreaker while other requests are still short-circuited, and state transit to `CLOSED` or `OPEN` based on the results of the permitted requests. | ||
|
||
### mesh.MonitorCert | ||
When `CLOSED`, the CircuitBreaker uses a sliding window to store and aggregate the result of recent requests, the window can either be `COUNT_BASED` or `TIME_BASED`. The `COUNT_BASED` window aggregates the last N requests and the `TIME_BASED` window aggregates requests in the last N seconds, where N is the window size. | ||
|
||
Below is an example configuration with both `COUNT_BASED` and `TIME_BASED` policies. Policy `circuit-breaker-example-count` short-circuits requests if more than half of recent requests failed. | ||
|
||
Policy `circuit-breaker-example-time` short-circuits requests if more than 60% of recent requests failed. | ||
|
||
> failed means that backend filter returns non-empty results. | ||
|
||
```yaml | ||
kind: CircuitBreaker | ||
name: circuit-breaker-example-count | ||
slidingWindowType: COUNT_BASED | ||
failureRateThreshold: 50 | ||
slidingWindowSize: 100 | ||
|
||
--- | ||
kind: CircuitBreaker | ||
name: circuit-breaker-example-time | ||
slidingWindowType: TIME_BASED | ||
failureRateThreshold: 60 | ||
slidingWindowSize: 100 | ||
``` |
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.
please refer https://github.com/megaease/easegress/blob/663a08344cc64fe6194c3fbe454c912e518a5a3a/doc/cookbook/resilience.md#circuit-break to update this part, and please make sure the kind should be CircuitBreak
instead of CircuitBreaker
.
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Co-authored-by: Bomin Zhang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## pipeline #665 +/- ##
===========================================
Coverage ? 78.70%
===========================================
Files ? 93
Lines ? 10098
Branches ? 0
===========================================
Hits ? 7948
Misses ? 1681
Partials ? 469 Continue to review full report at Codecov.
|
No description provided.