pub struct Policy {
pub drop_overloads: Vec<DropOverload>,
pub overprovisioning_factor: Option<UInt32Value>,
pub endpoint_stale_after: Option<Duration>,
pub weighted_priority_health: bool,
}
Expand description
Load balancing policy settings. [#next-free-field: 7]
Fields§
§drop_overloads: Vec<DropOverload>
Action to trim the overall incoming traffic to protect the upstream hosts. This action allows protection in case the hosts are unable to recover from an outage, or unable to autoscale or unable to handle incoming traffic volume for any reason.
At the client each category is applied one after the other to generate the ‘actual’ drop percentage on all outgoing traffic. For example:
.. code-block:: json
{ “drop_overloads”: [ { “category”: “throttle”, “drop_percentage”: 60 } { “category”: “lb”, “drop_percentage”: 50 } ]}
The actual drop percentages applied to the traffic at the clients will be “throttle”_drop = 60% “lb”_drop = 20% // 50% of the remaining ‘actual’ load, which is 40%. actual_outgoing_load = 20% // remaining after applying all categories.
Envoy supports only one element and will NACK if more than one element is present. Other xDS-capable data planes will not necessarily have this limitation.
In Envoy, this drop_overloads
config can be overridden by a runtime key
“load_balancing_policy.drop_overload_limit” setting. This runtime key can be set to
any integer number between 0 and 100. 0 means drop 0%. 100 means drop 100%.
When both drop_overloads
config and “load_balancing_policy.drop_overload_limit”
setting are in place, the min of these two wins.
overprovisioning_factor: Option<UInt32Value>
Priority levels and localities are considered overprovisioned with this factor (in percentage). This means that we don’t consider a priority level or locality unhealthy until the fraction of healthy hosts multiplied by the overprovisioning factor drops below 100. With the default value 140(1.4), Envoy doesn’t consider a priority level or a locality unhealthy until their percentage of healthy hosts drops below 72%. For example:
.. code-block:: json
{ “overprovisioning_factor”: 100 }
Read more at :ref:priority levels <arch_overview_load_balancing_priority_levels>
and
:ref:localities <arch_overview_load_balancing_locality_weighted_lb>
.
endpoint_stale_after: Option<Duration>
The max time until which the endpoints from this assignment can be used. If no new assignments are received before this time expires the endpoints are considered stale and should be marked unhealthy. Defaults to 0 which means endpoints never go stale.
weighted_priority_health: bool
If true, use the :ref:load balancing weight <envoy_v3_api_field_config.endpoint.v3.LbEndpoint.load_balancing_weight>
of healthy and unhealthy
hosts to determine the health of the priority level. If false, use the number of healthy and unhealthy hosts
to determine the health of the priority level, or in other words assume each host has a weight of 1 for
this calculation.
Note: this is not currently implemented for
:ref:locality weighted load balancing <arch_overview_load_balancing_locality_weighted_lb>
.
Trait Implementations§
Source§impl Message for Policy
impl Message for Policy
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl Name for Policy
impl Name for Policy
Source§const NAME: &'static str = "Policy"
const NAME: &'static str = "Policy"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.Source§const PACKAGE: &'static str = "envoy.config.endpoint.v3"
const PACKAGE: &'static str = "envoy.config.endpoint.v3"
.
, e.g. google.protobuf
.Source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request