1syntax = "proto3";
2
3package envoy.extensions.load_balancing_policies.least_request.v3;
4
5import "envoy/config/core/v3/base.proto";
6import "envoy/extensions/load_balancing_policies/common/v3/common.proto";
7
8import "google/protobuf/wrappers.proto";
9
10import "udpa/annotations/status.proto";
11import "validate/validate.proto";
12
13option java_package = "io.envoyproxy.envoy.extensions.load_balancing_policies.least_request.v3";
14option java_outer_classname = "LeastRequestProto";
15option java_multiple_files = true;
16option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/least_request/v3;least_requestv3";
17option (udpa.annotations.file_status).package_version_status = ACTIVE;
18
19// [#protodoc-title: Least Request Load Balancing Policy]
20// [#extension: envoy.load_balancing_policies.least_request]
21
22// This configuration allows the built-in LEAST_REQUEST LB policy to be configured via the LB policy
23// extension point. See the :ref:`load balancing architecture overview
24// <arch_overview_load_balancing_types>` for more information.
25message LeastRequest {
26  // The number of random healthy hosts from which the host with the fewest active requests will
27  // be chosen. Defaults to 2 so that we perform two-choice selection if the field is not set.
28  google.protobuf.UInt32Value choice_count = 1 [(validate.rules).uint32 = {gte: 2}];
29
30  // The following formula is used to calculate the dynamic weights when hosts have different load
31  // balancing weights:
32  //
33  // `weight = load_balancing_weight / (active_requests + 1)^active_request_bias`
34  //
35  // The larger the active request bias is, the more aggressively active requests will lower the
36  // effective weight when all host weights are not equal.
37  //
38  // `active_request_bias` must be greater than or equal to 0.0.
39  //
40  // When `active_request_bias == 0.0` the Least Request Load Balancer doesn't consider the number
41  // of active requests at the time it picks a host and behaves like the Round Robin Load
42  // Balancer.
43  //
44  // When `active_request_bias > 0.0` the Least Request Load Balancer scales the load balancing
45  // weight by the number of active requests at the time it does a pick.
46  //
47  // The value is cached for performance reasons and refreshed whenever one of the Load Balancer's
48  // host sets changes, e.g., whenever there is a host membership update or a host load balancing
49  // weight change.
50  //
51  // .. note::
52  //   This setting only takes effect if all host weights are not equal.
53  config.core.v3.RuntimeDouble active_request_bias = 2;
54
55  // Configuration for slow start mode.
56  // If this configuration is not set, slow start will not be not enabled.
57  common.v3.SlowStartConfig slow_start_config = 3;
58
59  // Configuration for local zone aware load balancing or locality weighted load balancing.
60  common.v3.LocalityLbConfig locality_lb_config = 4;
61}
62