Skip to main content
Version: 1.1.0

Latency AIMD Concurrency Limiting Policy

Introduction

This policy detects overloads/cascading failures by comparing the real-time latency with it's exponential moving average. Gradient controller is then used to calculate a proportional response that limits the accepted concurrency. Concurrency is increased additively when the overload is no longer detected.

info

AIMD stands for Additive Increase, Multiplicative Decrease. That is, the concurrency is reduced by a multiplicative factor when the service is overloaded and increased by an additive factor when the service is no longer overloaded.

Please see reference for the AIMDConcurrencyController component that is used within this blueprint.

info

See tutorials on Basic Concurrency Limiting and Workload Prioritization to see this blueprint in use.

Configuration

Code: policies/latency-aimd-concurrency-limiting

Common

Parametercommon.policy_name
Typestring
Default Value__REQUIRED_FIELD__
DescriptionName of the policy.

Policy

Parameterpolicy.flux_meter
Typeaperture.spec.v1.FluxMeter
Default Value{'flow_selector': {'flow_matcher': {'control_point': '__REQUIRED_FIELD__'}, 'service_selector': {'service': '__REQUIRED_FIELD__'}}}
DescriptionFlux Meter.
Parameterpolicy.flux_meter.flow_selector.service_selector.service
Typestring
Default Value__REQUIRED_FIELD__
DescriptionService Name.
Parameterpolicy.flux_meter.flow_selector.flow_matcher.control_point
Typestring
Default Value__REQUIRED_FIELD__
DescriptionControl Point Name.
Parameterpolicy.classifiers
Type[]aperture.spec.v1.Classifier
Default Value[]
DescriptionList of classification rules.
Parameterpolicy.components
Type[]aperture.spec.v1.Component
Default Value[]
DescriptionList of additional circuit components.

Latency Baseliner

Parameterpolicy.latency_baseliner.ema
Typeaperture.spec.v1.EMAParameters
Default Value{'correction_factor_on_max_envelope_violation': 0.95, 'ema_window': '1500s', 'warmup_window': '60s'}
DescriptionEMA parameters.
Parameterpolicy.latency_baseliner.latency_tolerance_multiplier
Typefloat64
Default Value1.1
DescriptionTolerance factor beyond which the service is considered to be in overloaded state. E.g. if EMA of latency is 50ms and if Tolerance is 1.1, then service is considered to be in overloaded state if current latency is more than 55ms.
Parameterpolicy.latency_baseliner.latency_ema_limit_multiplier
Typefloat64
Default Value2
DescriptionCurrent latency value is multiplied with this factor to calculate maximum envelope of Latency EMA.

Concurrency Controller

Parameterpolicy.concurrency_controller.flow_selector
Typeaperture.spec.v1.FlowSelector
Default Value{'flow_matcher': {'control_point': '__REQUIRED_FIELD__'}, 'service_selector': {'service': '__REQUIRED_FIELD__'}}
DescriptionConcurrency Limiter flow selector.
Parameterpolicy.concurrency_controller.flow_selector.service_selector.service
Typestring
Default Value__REQUIRED_FIELD__
DescriptionService Name.
Parameterpolicy.concurrency_controller.flow_selector.flow_matcher.control_point
Typestring
Default Value__REQUIRED_FIELD__
DescriptionControl Point Name.
Parameterpolicy.concurrency_controller.scheduler
Typeaperture.spec.v1.SchedulerParameters
Default Value{'auto_tokens': True}
DescriptionScheduler parameters.
Parameterpolicy.concurrency_controller.scheduler.auto_tokens
Typebool
Default Valuetrue
DescriptionAutomatically estimate cost (tokens) for workload requests.
Parameterpolicy.concurrency_controller.gradient
Typeaperture.spec.v1.GradientControllerParameters
Default Value{'max_gradient': 1, 'min_gradient': 0.1, 'slope': -1}
DescriptionGradient Controller parameters.
Parameterpolicy.concurrency_controller.alerter
Typeaperture.spec.v1.AlerterParameters
Default Value{'alert_name': 'Load Shed Event'}
DescriptionWhether tokens for workloads are computed dynamically or set statically by the user.
Parameterpolicy.concurrency_controller.max_load_multiplier
Typefloat64
Default Value2
DescriptionCurrent accepted concurrency is multiplied with this number to dynamically calculate the upper concurrency limit of a Service during normal (non-overload) state. This protects the Service from sudden spikes.
Parameterpolicy.concurrency_controller.load_multiplier_linear_increment
Typefloat64
Default Value0.0025
DescriptionLinear increment to load multiplier in each execution tick (0.5s) when the system is not in overloaded state.
Parameterpolicy.concurrency_controller.default_config
Typeaperture.spec.v1.LoadActuatorDynamicConfig
Default Value{'dry_run': False}
DescriptionDefault configuration for concurrency controller that can be updated at the runtime without shutting down the policy.

Dashboard

Parameterdashboard.refresh_interval
Typestring
Default Value'5s'
DescriptionRefresh interval for dashboard panels.
Parameterdashboard.time_from
Typestring
Default Value'now-15m'
DescriptionFrom time of dashboard.
Parameterdashboard.time_to
Typestring
Default Value'now'
DescriptionTo time of dashboard.

Datasource

Parameterdashboard.datasource.name
Typestring
Default Value'$datasource'
DescriptionDatasource name.
Parameterdashboard.datasource.filter_regex
Typestring
Default Value''
DescriptionDatasource filter regex.
note

The following configuration parameters can be dynamically configured at runtime, without reloading the policy.

Dynamic Configuration

Parameterconcurrency_controller
Typeaperture.spec.v1.LoadActuatorDynamicConfig
Default Value__REQUIRED_FIELD__
DescriptionDefault configuration for concurrency controller that can be updated at the runtime without shutting down the policy.