This topic describes the fields of AverageLatencySchedulingPolicy.
AverageLatencySchedulingPolicySpec
Field | Type | Description |
load_scheduling_core | The scheduler configuration. |
LoadSchedulingCore
Field | Type | Description |
aimd_load_scheduler | 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 | 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:
Match labels
Match expressions
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 | 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 | The list of labels matching requirements. |
Expression
Expression allows multiple variants, and only one of the fields can be configured.
Field | Type | Description |
all | The expression is true when all subexpressions are true, which is equivalent to the logical AND operation. | |
any | The expression is | |
label_equals | The expression is | |
label_exists | string | The expression is |
label_matches | The expression is | |
not | The expression negates the result of the subexpression. |
ExpressionList
Field | Type | Description |
of | 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 | 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 |
load_scheduler | 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.
|
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 | 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 | 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 | 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. |