From 5a27b05e95989f482e6c8919192c367eb4dec135 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Thu, 15 Nov 2018 04:53:30 +0000 Subject: [PATCH] load balancer: Option for power of N choices (#4593) Signed-off-by: Tony Allen Mirrored from https://github.com/envoyproxy/envoy @ cb44cf21fb29046c9ddc2bb54ed80a224453b7e5 --- envoy/api/v2/cds.proto | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/envoy/api/v2/cds.proto b/envoy/api/v2/cds.proto index faadc202..68af48bc 100644 --- a/envoy/api/v2/cds.proto +++ b/envoy/api/v2/cds.proto @@ -47,7 +47,7 @@ service ClusterDiscoveryService { // [#protodoc-title: Clusters] // Configuration for a single upstream cluster. -// [#comment:next free field: 37] +// [#comment:next free field: 38] message Cluster { // Supplies the name of the cluster which must be unique across all clusters. // The cluster name is used when emitting @@ -381,6 +381,13 @@ message Cluster { // Configuration for load balancing subsetting. LbSubsetConfig lb_subset_config = 22; + // Specific configuration for the LeastRequest load balancing policy. + message LeastRequestLbConfig { + // The number of random healthy hosts from which the host with the fewest active requests will + // be chosen. Defaults to 2 so that we perform two-choice selection if the field is not set. + google.protobuf.UInt32Value choice_count = 1 [(validate.rules).uint32.gte = 2]; + } + // Specific configuration for the :ref:`RingHash` // load balancing policy. message RingHashLbConfig { @@ -422,16 +429,18 @@ message Cluster { // Optional configuration for the load balancing algorithm selected by // LbPolicy. Currently only - // :ref:`RING_HASH` + // :ref:`RING_HASH` and + // :ref:`LEAST_REQUEST` // has additional configuration options. - // Specifying ring_hash_lb_config without setting the LbPolicy to - // :ref:`RING_HASH` - // will generate an error at runtime. + // Specifying ring_hash_lb_config or least_request_lb_config without setting the corresponding + // LbPolicy will generate an error at runtime. oneof lb_config { // Optional configuration for the Ring Hash load balancing policy. RingHashLbConfig ring_hash_lb_config = 23; // Optional configuration for the Original Destination load balancing policy. OriginalDstLbConfig original_dst_lb_config = 34; + // Optional configuration for the LeastRequest load balancing policy. + LeastRequestLbConfig least_request_lb_config = 37; } // Common configuration for all load balancer implementations.