Skip to content
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

Merged
merged 12 commits into from
Jun 24, 2022
Merged

update controller.md #665

merged 12 commits into from
Jun 24, 2022

Conversation

suchen-sci
Copy link
Contributor

No description provided.

@suchen-sci suchen-sci requested a review from localvar June 24, 2022 01:38
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
doc/reference/controllers.md Outdated Show resolved Hide resolved
Comment on lines 601 to 624
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
```
Copy link
Collaborator

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.

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2022

Codecov Report

❗ No coverage uploaded for pull request base (pipeline@0d7a961). Click here to learn what that means.
The diff coverage is n/a.

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

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d7a961...9667050. Read the comment docs.

@localvar localvar merged commit 2c5f8c7 into easegress-io:pipeline Jun 24, 2022
@suchen-sci suchen-sci deleted the update-doc branch June 24, 2022 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants