pub struct MemoryBoundsConfiguration {
pub memory_limit: Option<ByteSize>,
pub memory_slop_factor: f64,
pub enable_global_limiter: bool,
pub memory_mode: MemoryMode,
}Expand description
Configuration for memory bounds.
Fields§
§memory_limit: Option<ByteSize>Process memory limit. None enables cgroup detection.
memory_slop_factor: f64The slop factor to apply to the given memory limit.
Memory bounds are inherently fuzzy, as components are required to manually define their bounds, and as such, can only account for memory usage that they know about. The slop factor is applied as a reduction to the overall memory limit, such that we account for the “known unknowns” – memory that hasn’t yet been accounted for – by simply ensuring that we can fit within a portion of the overall limit.
Values between 0 to 1 are allowed, and represent the percentage of memory_limit that is held back. This means
that a slop factor of 0.25, for example, will cause 25% of memory_limit to be withheld. If memory_limit was
100 MB, we would then verify that the memory bounds can fit within 75 MB (100 MB * (1 - 0.25) => 75 MB).
enable_global_limiter: boolWhether or not to enable the global memory limiter.
When set to false, the global memory limiter will operate in a no-op mode. All calls to use it will never
exert backpressure, and only the inherent memory bounds of the running components will influence memory usage.
memory_mode: MemoryModeThe memory mode to use when reconciling the calculated memory bounds against the configured memory limit.
See MemoryMode for the available modes and their behavior.
Auto Trait Implementations§
impl Freeze for MemoryBoundsConfiguration
impl RefUnwindSafe for MemoryBoundsConfiguration
impl Send for MemoryBoundsConfiguration
impl Sync for MemoryBoundsConfiguration
impl Unpin for MemoryBoundsConfiguration
impl UnwindSafe for MemoryBoundsConfiguration
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> 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::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more