pub struct AimdConfig {
pub initial_rate: f64,
pub min_rate: f64,
pub max_rate: f64,
pub decrease_factor: f64,
pub additive_increment: f64,
pub window_duration: Duration,
pub throttle_threshold: f64,
}Expand description
Configuration for the AIMD rate controller.
Use builder methods to customize. Defaults are tuned for cloud object stores and will start at about 40% of the max rate and require 10 seconds to reach the max rate.
- initial_rate: 2000 req/s
- min_rate: 1 req/s
- max_rate: 5000 req/s (0.0 disables ceiling)
- decrease_factor: 0.5 (halve on throttle)
- additive_increment: 300 req/s per success window
- window_duration: 1 second
- throttle_threshold: 0.0 (any throttle triggers decrease)
Fields§
§initial_rate: f64§min_rate: f64§max_rate: f64§decrease_factor: f64§additive_increment: f64§window_duration: Duration§throttle_threshold: f64Implementations§
Source§impl AimdConfig
impl AimdConfig
pub fn with_initial_rate(self, initial_rate: f64) -> Self
pub fn with_min_rate(self, min_rate: f64) -> Self
pub fn with_max_rate(self, max_rate: f64) -> Self
pub fn with_decrease_factor(self, decrease_factor: f64) -> Self
pub fn with_additive_increment(self, additive_increment: f64) -> Self
pub fn with_window_duration(self, window_duration: Duration) -> Self
pub fn with_throttle_threshold(self, throttle_threshold: f64) -> Self
Trait Implementations§
Source§impl Clone for AimdConfig
impl Clone for AimdConfig
Source§fn clone(&self) -> AimdConfig
fn clone(&self) -> AimdConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AimdConfig
impl Debug for AimdConfig
Auto Trait Implementations§
impl Freeze for AimdConfig
impl RefUnwindSafe for AimdConfig
impl Send for AimdConfig
impl Sync for AimdConfig
impl Unpin for AimdConfig
impl UnsafeUnpin for AimdConfig
impl UnwindSafe for AimdConfig
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more