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

feat(kuma-cp): CircuitBreaker proposal #751

Merged
merged 2 commits into from
Jun 2, 2020

Conversation

lobkovilya
Copy link
Contributor

Summary

An initial version of the proposal for the new policy "CircuitBreaker"

@lobkovilya lobkovilya requested a review from a team May 20, 2020 02:10
```
So circuit breaker in Envoy is a bunch of thresholds which prevents service from opening more new connections and create more new requests than configured. Also, it could limit the number of retries that happen in parallel.

That functionality of Envoy doesn't allow implementing design pattern described above. In order to make it work there is another useful Envoy feature called `cluster.OutlierDetection`:
Copy link
Contributor

Choose a reason for hiding this comment

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

We use outlier detection already for passive healthchecks https://kuma.io/docs/0.5.0/policies/health-check/ (check ClusterWithHealthChecks method). I think it makes sense to add more settings to passive healthchecks or get rid of passive HC and create Circuit Breaker.

"retry_budget": "{...}",
"track_remaining": "...",
"max_connection_pools": "{...}"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This configuration is also important and can be a blocker when adopting Kuma. Especially max_connections

@lobkovilya
Copy link
Contributor Author

lobkovilya commented May 20, 2020

@subnetmarco looks like we have several ways to implement CircuitBreaker:

  • Get rid of passive HealthCheck and have all kinds of circuit breaking in one Policy:

    type: CircuitBreaker
    mesh: default
    name: cb-1
    selector:
      - match:
          service: backend 
          region: was
          version: 3
    conf:
      maxConnections: 3
      maxPendingRequest: 10
      ...
      interval: 1s
      baseEjectionTime: 30s
      maxEjectionPercent: 20
      splitExternalAndLocalErrors: false
      detectors:
        errors:
          total: 20
          gateway: 10
          local: 7
        standardDeviation:
          requestVolume: 10
          minimumHosts: 5
          factor: 1.9
        failure:
          requestVolume: 10
          minimumHosts: 5
          threshold: 85

    This approach closer to design patter called "Circuit breaker".

  • Leave HealthCheck policy as it is. Enhance passive HealthCheck with additional parameters for outlier detection. Create CircuitBreaker policy that easily maps to Envoy's cluster.CircuitBreakers:

    type: CircuitBreaker
    mesh: default
    name: cb-1
    selector:
      - match:
          service: backend 
          region: was
          version: 3
    conf:
      maxConnections: 3
      maxPendingRequest: 10
      maxRequests: 10
      maxRetries: 3

    Write documentation page "Circuit Breakers" where we will show both passive HealthCheck and CircuitBreaker.
    This approach probably closer to Envoy users.

Do we have any notion what users expect from Kuma when it comes to Circuit breakers?

@subnetmarco
Copy link
Contributor

I suggest that we add the CircuitBreaker resource and remove passive healthchecking from the Healthcheck resource.

@lobkovilya lobkovilya merged commit a4bcf3c into master Jun 2, 2020
@lobkovilya lobkovilya deleted the feat/proposal-circuit-breaker branch July 29, 2020 14:00
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

4 participants