Skip to content

CircuitBreakers

Anker Tsaur edited this page Jul 28, 2022 · 5 revisions

Overview

Circuit breaker configuration

The circuit breaker can be configured in following places

  • values.yaml of the service helm chart
    • titanSideCars.envoy.clusters.local-myapp.circuitBreakers
    • titanSideCars.envoy.clusters.remote-myapp.circuitBreakers
  • values.yaml of the umbrella helm chart
    • global.titanSideCars.envoy.localCircuitBreakers
    • global.titanSideCars.envoy.remoteCircuitBreakers

CircuitBreakers

Here are available configurations:

max_requests:           integer
max_connections:        integer
max_pending_requests:   integer
retryBudgetPercentage:  float
minRetryConcurrency:    integer

max_requests

(integer) The maximum number of requests that can be outstanding to all hosts in a cluster at any given time.

If not set, the default value set to 1024

This setting is important and applies the same restriction no matter what HTTP protocol is used.

max_connections

(integer) The maximum number of connections that Envoy will establish to all hosts in an upstream cluster

If not set, the default value set to 1024

This setting is important for HTTP1/1.

For HTTP/2 connections, all requests will be multiplexed over the same connection to the upstream host of the cluster.

  • One connection per host of a cluster.

max_pending_requests

(integer) The maximum number of requests that will be queued while waiting for a ready connection pool connection.

If not set, the default value set to 1024

This setting is important for HTTP1/1.

For HTTP/2 connections, all requests will be multiplexed over the same connection to the upstream host of the cluster.

retryBudgetPercentage

(float) Specifies the limit on concurrent retries as a percentage of the sum of active requests and active pending requests.

For example, if there are 100 active requests and the budget_percent is set to 25, there may be 25 active retries.

If not set, the default value set to 20.0 %

minRetryConcurrency

(integer) Specifies the minimum retry concurrency allowed for the retry budget. The limit on the number of active retries may never go below this number.

If not set, the default value set to 3

Example

my local app

4 pods cluster

support HTTP1/1 only

titanSideCars:
  envoy:
    clusters: 
      local-myapp: // HTTP1/1 to my local app
        circuitBreakers:
          maxRequests: 1024
          maxConnections: 1024
          maxPendingRequests: 1024
          retryBudgetPercentage: 25.0
          minRetryConcurrency: 3
      remote-myapp: // HTTP/2 to my envoy sidecar
        circuitBreakers:
          maxRequests: 8192
          retryBudgetPercentage: 25.0
          minRetryConcurrency: 12