Skip to content

ResilienceMechanisms

L. Wagner edited this page May 9, 2022 · 2 revisions

Supported Resilience Mechanisms

Timeout

MiSim enforces a timeout of 8 STU.
It is currently not modifiable outside the code.

Retry

A strategic instance owned pattern that resents failed requests after a short delay.

JSON Type Names

  • "retry"

Properties

Property Description Default
maxTries The maximum number of retries. 5

Strategies

  • "linear"
  • "exponential" / "exp"
  • "jittering"
  • "jittering_linear"

All with the following properties:

Property Description Default
base Multiplication base of the approach. 3
baseBackoff Base back off value for the first attempt. 0.010
maxBackoff Maximum Back off 1

Example

{
    "type": "retry",
    "config": {
        "maxTries": 3
    }
    "strategy": {
        "type": "jittering",
        "config": {
            "baseBackoff": 0.050,
            "maxBackoff": 2,
            "base": 2.25
        }
}

Circuit Breaker

An instance owned pattern that detects failing connections and employs a fail-fast strategy. Creates a circuit breaker for each target service independently.

JSON Type Names

  • "circuitbreaker"

Properties

Property Description Default
requestVolumeThreshold Maximum number of allowed concurrent connections. Integer.MAX_VALUE
threshold Failure rate threshold at which the breaker should open. Double.POSITIVE_INFINITY
rollingWindow Time window over which the failure rate should be calculated. 20 STU
sleepWindow Time to wait until switching from OPEN to HALF-OPEN state. 0.5 STU

Example

{
  "type": "circuitbreaker",
  "config": {
    "threshold": 0.5,
    "rollingWindow": 10,
    "sleepWindow": 10.1
  }
}

Load Balancer

A strategic service owned pattern that distributes requests to multiple target instances. Every service must have a load balancer. If none is provided specifically a random strategy is used.

Strategies

Strategy Description
random Randomly selects a target instance.
round_robin Selects the next target instance in a round-robin fashion.
round_robin_fast Selects the next target instance in a round-robin fashion. It is not as fair as an actual round_robin, but slightly faster.
utilization Selects the target instance with the lowest current relative utilization.

Example

{//In Service description
    ...
    "loadbalancer_strategy" : "round_robin",
    ...
}