Skip to content

Commit

Permalink
Feature/cherry pick slow start support 1.9.8 (#6)
Browse files Browse the repository at this point in the history
* feat: cherry pick commit 6c56dd8

Support slow Start mode in Envoy (envoyproxy#13176)

* fix: fix compile error

* fix: run proto_format.sh

* fix: include file error fix

* fix: remove undefined fields

* fix: assign lb_round_robin_config_ in ClusterInfoImpl constructor

* fix: change applySlowStartFactor to use static 0.3 * host_weight as new weight

because formula way will result too small new weight which cause the edf will wait a long time to
choose the slow start endpoint

Co-authored-by: jst <[email protected]>
  • Loading branch information
jiangshantao-dbg and jst authored Jan 14, 2022
1 parent 95b418f commit 454c405
Show file tree
Hide file tree
Showing 29 changed files with 4,119 additions and 115 deletions.
38 changes: 37 additions & 1 deletion api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ message ClusterCollection {
}

// Configuration for a single upstream cluster.
// [#next-free-field: 53]
// [#next-free-field: 57]
message Cluster {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.Cluster";

Expand Down Expand Up @@ -334,6 +334,35 @@ message Cluster {
bool list_as_any = 7;
}

// Configuration for :ref:`slow start mode <arch_overview_load_balancing_slow_start>`.
message SlowStartConfig {
// Represents the size of slow start window.
// If set, the newly created host remains in slow start mode starting from its creation time
// for the duration of slow start window.
google.protobuf.Duration slow_start_window = 1;

// This parameter controls the speed of traffic increase over the slow start window. Defaults to 1.0,
// so that endpoint would get linearly increasing amount of traffic.
// When increasing the value for this parameter, the speed of traffic ramp-up increases non-linearly.
// The value of aggression parameter should be greater than 0.0.
// By tuning the parameter, is possible to achieve polynomial or exponential shape of ramp-up curve.
//
// During slow start window, effective weight of an endpoint would be scaled with time factor and aggression:
// `new_weight = weight * time_factor ^ (1 / aggression)`,
// where `time_factor=(time_since_start_seconds / slow_start_time_seconds)`.
//
// As time progresses, more and more traffic would be sent to endpoint, which is in slow start window.
// Once host exits slow start, time_factor and aggression no longer affect its weight.
core.v3.RuntimeDouble aggression = 2;
}

// Specific configuration for the RoundRobin load balancing policy.
message RoundRobinLbConfig {
// Configuration for slow start mode.
// If this configuration is not set, slow start will not be not enabled.
SlowStartConfig slow_start_config = 1;
}

// Specific configuration for the LeastRequest load balancing policy.
message LeastRequestLbConfig {
option (udpa.annotations.versioning).previous_message_type =
Expand Down Expand Up @@ -367,6 +396,10 @@ message Cluster {
// .. note::
// This setting only takes effect if all host weights are not equal.
core.v3.RuntimeDouble active_request_bias = 2;

// Configuration for slow start mode.
// If this configuration is not set, slow start will not be not enabled.
SlowStartConfig slow_start_config = 3;
}

// Specific configuration for the :ref:`RingHash<arch_overview_load_balancing_types_ring_hash>`
Expand Down Expand Up @@ -918,6 +951,9 @@ message Cluster {

// Optional configuration for the LeastRequest load balancing policy.
LeastRequestLbConfig least_request_lb_config = 37;

// Optional configuration for the RoundRobin load balancing policy.
RoundRobinLbConfig round_robin_lb_config = 56;
}

// Common configuration for all load balancer implementations.
Expand Down
44 changes: 43 additions & 1 deletion api/envoy/config/cluster/v4alpha/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 454c405

Please sign in to comment.