All Products
Search
Document Center

Alibaba Cloud Service Mesh:Description of AverageLatencySchedulingPolicy fields

Last Updated:Aug 02, 2024

This topic describes the fields of AverageLatencySchedulingPolicy.

AverageLatencySchedulingPolicySpec

Field

Type

Description

load_scheduling_core

LoadSchedulingCore

The scheduler configuration.

LoadSchedulingCore

Field

Type

Description

aimd_load_scheduler

AimdLoadScheduler

The configuration of the Additive Increase Multiplicative Decrease (AIMD) scheduler.

Selector

Traffic flows are selected based on control point, flow label, agent group, and service.

control_point: ingress
label_matcher:
  match_labels:
    user_tier: gold
  match_expressions:
    - key: query
      operator: In
      values:
        - insert
        - delete
  expression:
    label_matches:
      - label: user_agent
        regex: ^(?!.*Chrome).*Safari

Field

Type

Description

control_point

string

This field identifies the location within services where policies take effect for traffic flows. You can set this field to ingress, egress, a specific listener, or a specific filter chain. Default value: ingress.

label_matcher

LabelMatcher

This field can be used to match traffic flows based on flow labels.

service

string

The Fully Qualified Domain Name (FQDN) of the service to select. Default value: any.

LabelMatcher

It provides three methods to define requirements:

  1. Match labels

  2. Match expressions

  3. Arbitrary expression

If multiple requirements are set, they are all combined by using the logical AND operator. An empty label matcher always matches any requests.

Field

Type

Description

expression

Expression

An expression to be evaluated on the labels.

match_labels

map[string]string

A map of key-value pairs that represent the labels to be matched.

match_list

MatchRequirement

The list of labels matching requirements.

Expression

Expression allows multiple variants, and only one of the fields can be configured.

Field

Type

Description

all

ExpressionList

The expression is true when all subexpressions are true, which is equivalent to the logical AND operation.

any

ExpressionList

The expression is true when any subexpression is true, which is equivalent to the logical OR operation.

label_equals

EqualExpression

The expression is true when the value of the specified label equals the given value.

label_exists

string

The expression is true when a label with the given name exists.

label_matches

MatchesExpression

The expression is true when the specified label matches the given regular expression.

not

Expression

The expression negates the result of the subexpression.

ExpressionList

Field

Type

Description

of

[]Expression

The list of subexpressions of the match expression.

EqualExpression

Field

Type

Description

label

string

The label key. This field is required.

value

string

The label value.

MatchesExpression

Field

Type

Description

label

string

The name of the label to match the regular expression. This field is required.

regex

string

A regular expression that should match the label value. This field is required. For more information, see Regular expression syntax of Go.

MatchRequirement

Field

Type

Description

key

string

The label key that the selector applies to. This field is required.

operator

Enumeration

Valid values: In, NotIn, Exists, and DoesNotExist. This field is required.

values

[]string

An array of string values that relates to the key by an operator. If the operator is Exists or DoesNotExist, the values array must be empty.

AimdLoadScheduler

Field

Type

Description

gradient

GradientControllerParameters

The parameters for the gradient controller. This field is required.

load_multiplier_linear_increment

float64

The minimum value is 0 and the default value is 0.025. This field specifies the linear increment to the load multiplier every 10 seconds when the system is not in the overloaded state, until max_load_multiplier is reached.

load_scheduler

LoadSchedulerParameters

The parameters for the load scheduler. This field is required.

max_load_multiplier

float64

The minimum value is 0. The default value is 2.

The field specifies the maximum load multiplier that can be reached during recovery from an overloaded state.

  • This field helps protect the service from request bursts when the system is still recovering.

  • Once the value of this field is reached, the scheduler enters the pass-through mode. This mode allows requests to bypass the scheduler and be sent directly to the service.

  • The pass-through mode is disabled if the system enters the overloaded state again.

GradientControllerParameters

The following table describes the gradient parameters.

Field

Type

Description

max_gradient

float64

Default value: 1.

min_gradient

float64

Default value: 0.1.

slope

float64

Default value: -1.

The slope field controls the aggressiveness and direction of the gradient controller. This field is used as exponent on the signal to setpoint ratio in computation of the gradient. Example:

  • slope = 1: When the signal is too high, increase the control variable.

  • slope = -1: When the signal is too high, decrease the control variable.

  • slope = -0.5: When the signal is too high, decrease the control variable gradually.

It is recommended that the absolute value of slope does not exceed 1.

LoadSchedulerParameters

Field

Type

Description

scheduler

Scheduler

The configuration of the Weighted Fair Queuing-based workload scheduler.

selectors

[]Selector

The selectors for the Weighted Fair Queuing-based workload scheduler.

workload_latency_based_tokens

bool

Default value: false. The size of traffic flows within each workload is automatically estimated based on historical latency. The number of tokens for each workload is set to the average latency of traffic flows in the workload during the last few seconds (the exact duration of this average can change). This setting is useful in concurrency limiting scenarios, where the concurrency is calculated by using the following formula: Concurrency = avg.latency × in-flight flows.

The value of tokens estimated takes a lower precedence than the value of tokens specified in the workload definition and the value of tokens explicitly specified in the flow labels.

Scheduler

Field

Type

Description

workloads

[]SchedulerWorkload

The list of workloads to be used.

SchedulerWorkload

Field

Type

Description

label_matcher

LabelMatcher

The label matcher to select a workload based on flow labels.

Name

string

The workload name.

Parameters

SchedulerWorkloadParameters

The parameters associated with traffic flows matching the label matcher.

SchedulerWorkloadParameters

Field

Type

Description

priority

float64

The priority.

queue_timeout

string

The timeout for the traffic flows in the workload.

tokens

float64

The tokens field determines the cost of admitting a single traffic flow in the workload, which is typically defined as milliseconds of flow latency (time to response or duration of a feature) or simply equal to 1 if the resource being accessed is constrained by the number of traffic flows (third-party rate limiters). This override is applicable only if the number of tokens is not specified in the flow labels.