Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_balancing: support least_connections steering policy #1414

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1414.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
load_balancing: extend documentation for least_connections steering policy
```
14 changes: 14 additions & 0 deletions load_balancing.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ type LoadBalancerOrigin struct {
//
// When LoadBalancerOriginSteering.Policy="least_outstanding_requests", this
// weight is used to scale the origin's outstanding requests.
// When LoadBalancerOriginSteering.Policy="least_connections", this
// weight is used to scale the origin's open connections.
Weight float64 `json:"weight"`
Header map[string][]string `json:"header"`
}
Expand All @@ -59,6 +61,10 @@ type LoadBalancerOriginSteering struct {
// "least_outstanding_requests": Select an origin by taking into consideration origin weights,
// as well as each origin's number of outstanding requests. Origins with more pending requests
// are weighted proportionately less relative to others.
//
// "least_connections": Select an origin by taking into consideration origin weights,
// as well as each origin's number of open connections. Origins with more open connections
// are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
Policy string `json:"policy,omitempty"`
}

Expand Down Expand Up @@ -127,6 +133,11 @@ type LoadBalancer struct {
// RandomSteering weights, as well as each pool's number of outstanding requests.
// Pools with more pending requests are weighted proportionately less relative to others.
//
// "least_connections": Select a pool by taking into consideration
// RandomSteering weights, as well as each pool's number of open connections.
// Pools with more open connections are weighted proportionately less relative to others.
// Supported for HTTP/1 and HTTP/2 connections.
//
// "": Maps to "geo" if RegionPools or PopPools or CountryPools have entries otherwise "off".
SteeringPolicy string `json:"steering_policy,omitempty"`
}
Expand Down Expand Up @@ -207,6 +218,9 @@ type LoadBalancerRuleOverrides struct {
//
// SteeringPolicy="least_outstanding_requests": Use pool weights to
// scale each pool's outstanding requests.
//
// SteeringPolicy="least_connections": Use pool weights to
// scale each pool's open connections.
type RandomSteering struct {
DefaultWeight float64 `json:"default_weight,omitempty"`
PoolWeights map[string]float64 `json:"pool_weights,omitempty"`
Expand Down
Loading