Add ZoneAwareLB settings for MeshConfig and DestinationRule#3733
Conversation
|
😊 Welcome @sschepens! This is either your first contribution to the Istio api repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
@ramaraochavali @keithmattix @howardjohn could you take a look at this please? |
d14020f to
97dd888
Compare
ramaraochavali
left a comment
There was a problem hiding this comment.
Added some comments. @hzxuzhonghu can you PTAL as well?
| // | ||
| // - The downstream proxy is configured with `ISTIO_META_ENABLE_SELF_DISCOVERY=true` | ||
| // (set via `proxyMetadata`). | ||
| // - The upstream cluster has at least `minClusterSize` hosts (default 6). Below |
There was a problem hiding this comment.
What is the significance of minClusterSize and the default value 6? Does it mean if a service has two pods per AZ - we can not use zone aware load balancing?
There was a problem hiding this comment.
If it has two AZs and two pods per AZ, then by default it wouldn't do ZoneAwareRouting, but this is configurable of course, this is just Envoy's default.
There isn't much documentation on why the default is 6. My understanding is that this is based on statistical analysis, since Zone Aware Routing computes per-zone percentages based on the ratio of local-zone hosts to total hosts and deciding which fraction of traffic can stay local vs what must be sent cross-zone to keep hosts evenly loaded. When you have very few hosts the traffic can be skewed by rounding and end up being not very accurate. Also with very little hosts, when a host appears/disappears it changes the percentages dramatically which make the traffic distribution unstable, you could end up overloading individual hosts.
| // this threshold zone-aware load balancing is disabled entirely, regardless of other | ||
| // settings. | ||
| // - The upstream cluster spans more than one zone. | ||
| // - There is at least one healthy endpoint in the local zone. |
There was a problem hiding this comment.
So if all endpoints in the local zone are unhealthy would the traffic spill over to other zones as per the zone aware load balancing calculations or is it completely disabled? Which load balancing is used if it is disabled?
There was a problem hiding this comment.
I can clarify this, if all endpoints in the local zone are unhealthy traffic spills to other zones, basically envoy "fallbacks" to doing the selected LB algorithm (ie ROUND_ROBIN, etc) across all the endpoints of priority 0. Just as if you were to configure locality weigthed lb without specifying locality weights.
| // apply. This is useful when failing over traffic across regions would not | ||
| // improve service health or may need to be restricted for other reasons | ||
| // like regulatory controls. | ||
| message Failover { |
There was a problem hiding this comment.
Should we call this FailoverRegion or call from and to as from_region and to_region to be explicit?
There was a problem hiding this comment.
We could, but my intention was to leave this the same as in LocalityLbSetting, in both cases you can only specify regions, I'd prefer to maintain the consistency.
| // Minimum number of hosts in the upstream cluster required for zone-aware | ||
| // load balancing to be enabled. If the total number of upstream hosts falls below | ||
| // this value, zone-aware load balancing is disabled for this cluster regardless of | ||
| // other settings. This guards against zone-skew issues that can occur with |
There was a problem hiding this comment.
This is confusing. Is it total number of hosts in upstream cluster or is it per zone? How is zone-skew identified based on upstream cluster hosts count?
There was a problem hiding this comment.
It's the total number of hosts across all zones in priority 0 (same region).
Regarding the skew, I have clarified this in the first comment.
There was a problem hiding this comment.
do you think we should clarify this further in the documentation?
|
@ramaraochavali I improved the docs a bit. Do you think we should further explain why |
3f85b5e to
8d2f811
Compare
I think "why" it is needed is clear. But what value should be configured by user is not clear. How will I know what to set? How to tune it - are there any envoy stats that help us to tune it? |
You could just check per-host and per-az traffic to see if the traffic is unbalanced. Envoy also provides per-zone stats which adds stats a per-zone stat to upstream cluster, you can use this to correctly verify that you're doing Zone Aware Routing and to know how much traffic is being kept local vs remote. |
|
ok. Looks like Should we just keep this out of our API? have you seen any one having need to tweak this? |
Yes, it turns off and on automatically when the cluster size changes (for example HPA).
I'd prefer we kept it, we had some cases in which we had to configure this for some services, it's really the only knob Zone Aware Routing has, the other knobs are just failover configurations which are not strictly part of Zone Aware Routing. |
|
@ramaraochavali I'm gonna remove the release note check on this since it will be added with the implementation PR |
|
/retest |
| // However, this requires outlierDetection to actually take effect for a particular | ||
| // Only one of locality_lb_setting and zone_aware_lb_setting should be enabled; | ||
| // if both are set, zone_aware_lb_setting takes precedence and this setting is ignored. | ||
| // Failover settings, require outlierDetection to actually take effect for a particular |
There was a problem hiding this comment.
| // Failover settings, require outlierDetection to actually take effect for a particular | |
| // Failover settings require outlierDetection to actually take effect for a particular |
This is needed to implement Zone Aware Routing support in Istio.
I'm adding a
zone_aware_lb_settinginDestinationRuleto allow configuring enabling Zone Aware LB,it's mutually exclusive withlocality_lb_settingand it's settings are very similar, with the following differences:distributeis not actually needed here because Envoy distributes traffic automaticallyfailoverPrioritycannot specifyregion,zoneorsubZonetopology labels because we always partition byregionandzoneandsubZonedon't make sense with Zone Aware because envoy automatically shifts traffic between zones.I'm also adding a mesh-wide
zone_aware_lb_settingto enable zone aware routing globally. For practical reasons, there is no way to simply reject this setting being enabled together withlocality_lb_settingbecauselocality_lb_settingis actually enabled by default and validation occurs with the defaults merged.Issue: istio/istio#35102 (comment)
RFC: https://docs.google.com/document/d/1nPVSTIy_s0s9cRBS7DNwHZkDXhHO1qW4x9F9W7y_gyo/edit?tab=t.0#heading=h.xw1gqgyqs5b