Skip to content

Commit

Permalink
Initial slow start support (#7810) (#7905)
Browse files Browse the repository at this point in the history
* Initial slow start support (#7810)

* Initial slow start support

* Add changelog

* Update changelog

* Update changelog version

* Update changelog version

* Update changelog version

---------

Co-authored-by: Nathan Fudenberg <[email protected]>

* ci

* changelog: Backport requires downgrade of type

---------

Co-authored-by: Nick Caballero <[email protected]>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 3, 2023
1 parent 6f80d88 commit 43cefbf
Show file tree
Hide file tree
Showing 10 changed files with 649 additions and 66 deletions.
4 changes: 4 additions & 0 deletions changelog/v1.13.9/envoy-slow-start-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/gloo/issues/7807
description: Expose `config.core.v3.Cluster.SlowStartConfig` for `RoundRobin` and `LeastRequest` load balancers. Requires CRD update to be able to use.

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

23 changes: 23 additions & 0 deletions install/helm/gloo/crds/gloo.solo.io_v1_Upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,17 @@ spec:
choiceCount:
format: int32
type: integer
slowStartConfig:
properties:
aggression:
nullable: true
type: number
minWeightPercent:
nullable: true
type: number
slowStartWindow:
type: string
type: object
type: object
localityWeightedLbConfig:
maxProperties: 0
Expand All @@ -907,6 +918,18 @@ spec:
type: object
type: object
roundRobin:
properties:
slowStartConfig:
properties:
aggression:
nullable: true
type: number
minWeightPercent:
nullable: true
type: number
slowStartWindow:
type: string
type: object
type: object
updateMergeWindow:
type: string
Expand Down
33 changes: 32 additions & 1 deletion projects/gloo/api/v1/load_balancer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ message LoadBalancerConfig {
// Set to 0 to disable and have changes applied immediately.
google.protobuf.Duration update_merge_window = 2;

message RoundRobin {}
message RoundRobin {
// Configuration for slow start mode. If this configuration is not set, slow start will not be not enabled.
SlowStartConfig slow_start_config = 1;
}
message LeastRequest {
// How many choices to take into account. defaults to 2.
uint32 choice_count = 1;

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

Expand Down Expand Up @@ -72,4 +78,29 @@ message LoadBalancerConfig {
google.protobuf.Empty locality_weighted_lb_config = 8;
}

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 * max(min_weight_percent, 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.
google.protobuf.DoubleValue aggression = 2;

// Configures the minimum percentage of origin weight that avoids too small new weight,
// which may cause endpoints in slow start mode receive no traffic in slow start window.
// If not specified, the default is 10%.
google.protobuf.DoubleValue min_weight_percent = 3;
}
}
41 changes: 41 additions & 0 deletions projects/gloo/pkg/api/v1/load_balancer.pb.clone.go

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

74 changes: 74 additions & 0 deletions projects/gloo/pkg/api/v1/load_balancer.pb.equal.go

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

Loading

0 comments on commit 43cefbf

Please sign in to comment.