Enum google_api_proto::google::cloud::compute::v1::backend_service::LocalityLbPolicy
source · #[repr(i32)]pub enum LocalityLbPolicy {
UndefinedLocalityLbPolicy = 0,
InvalidLbPolicy = 323_318_707,
LeastRequest = 46_604_921,
Maglev = 119_180_266,
OriginalDestination = 166_297_216,
Random = 262_527_171,
RingHash = 432_795_069,
RoundRobin = 153_895_801,
WeightedMaglev = 254_930_962,
}
Expand description
The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not NONE, and this field is not set to MAGLEV or RING_HASH, session affinity settings will not take effect. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
Variants§
UndefinedLocalityLbPolicy = 0
A value indicating that the enum field is not set.
InvalidLbPolicy = 323_318_707
LeastRequest = 46_604_921
An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests.
Maglev = 119_180_266
This algorithm implements consistent hashing to backends. Maglev can be used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824
OriginalDestination = 166_297_216
Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer.
Random = 262_527_171
The load balancer selects a random healthy host.
RingHash = 432_795_069
The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests.
RoundRobin = 153_895_801
This is a simple policy in which each healthy backend is selected in round robin order. This is the default.
WeightedMaglev = 254_930_962
Per-instance weighted Load Balancing via health check reported weights. If set, the Backend Service must configure a non legacy HTTP-based Health Check, and health check replies are expected to contain non-standard HTTP response header field X-Load-Balancing-Endpoint-Weight to specify the per-instance weights. If set, Load Balancing is weighted based on the per-instance weights reported in the last processed health check replies, as long as every instance either reported a valid weight or had UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This option is only supported in Network Load Balancing.
Implementations§
source§impl LocalityLbPolicy
impl LocalityLbPolicy
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for LocalityLbPolicy
impl Clone for LocalityLbPolicy
source§fn clone(&self) -> LocalityLbPolicy
fn clone(&self) -> LocalityLbPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LocalityLbPolicy
impl Debug for LocalityLbPolicy
source§impl Default for LocalityLbPolicy
impl Default for LocalityLbPolicy
source§fn default() -> LocalityLbPolicy
fn default() -> LocalityLbPolicy
source§impl From<LocalityLbPolicy> for i32
impl From<LocalityLbPolicy> for i32
source§fn from(value: LocalityLbPolicy) -> i32
fn from(value: LocalityLbPolicy) -> i32
source§impl Hash for LocalityLbPolicy
impl Hash for LocalityLbPolicy
source§impl Ord for LocalityLbPolicy
impl Ord for LocalityLbPolicy
source§fn cmp(&self, other: &LocalityLbPolicy) -> Ordering
fn cmp(&self, other: &LocalityLbPolicy) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for LocalityLbPolicy
impl PartialEq for LocalityLbPolicy
source§fn eq(&self, other: &LocalityLbPolicy) -> bool
fn eq(&self, other: &LocalityLbPolicy) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for LocalityLbPolicy
impl PartialOrd for LocalityLbPolicy
source§fn partial_cmp(&self, other: &LocalityLbPolicy) -> Option<Ordering>
fn partial_cmp(&self, other: &LocalityLbPolicy) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for LocalityLbPolicy
impl TryFrom<i32> for LocalityLbPolicy
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
source§fn try_from(value: i32) -> Result<LocalityLbPolicy, UnknownEnumValue>
fn try_from(value: i32) -> Result<LocalityLbPolicy, UnknownEnumValue>
impl Copy for LocalityLbPolicy
impl Eq for LocalityLbPolicy
impl StructuralPartialEq for LocalityLbPolicy
Auto Trait Implementations§
impl Freeze for LocalityLbPolicy
impl RefUnwindSafe for LocalityLbPolicy
impl Send for LocalityLbPolicy
impl Sync for LocalityLbPolicy
impl Unpin for LocalityLbPolicy
impl UnwindSafe for LocalityLbPolicy
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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