pub struct LimiterConfig {
pub enabled: bool,
pub min_concurrency: usize,
pub max_concurrency: usize,
pub window_ops: usize,
pub min_window_ops: usize,
pub success_target: f64,
pub timeout_ceiling: f64,
pub latency_inflation_factor: f64,
pub latency_ewma_alpha: f64,
pub slow_start_ramp_threshold: usize,
pub latency_decrease_enabled: bool,
}Expand description
Per-limiter configuration. Carries the shared adaptive parameters
plus the channel-specific max_concurrency. Held behind an Arc
so cloning a Limiter is a refcount bump rather than a struct copy
(avoids allocating AdaptiveConfig-worth of bytes per chunk in
hot loops).
Fields§
§enabled: bool§min_concurrency: usize§max_concurrency: usize§window_ops: usize§min_window_ops: usize§success_target: f64§timeout_ceiling: f64§latency_inflation_factor: f64§latency_ewma_alpha: f64§slow_start_ramp_threshold: usizeWhile current < slow_start_ramp_threshold, a Decrease halves
the cap but does NOT permanently exit slow-start — the next
healthy window can double the cap back up. Above the threshold,
a Decrease exits slow-start and the controller transitions to
classic AIMD (+1 per healthy window).
0 (the default) reproduces the original behaviour: any Decrease
at any cap permanently exits slow-start. The fetch channel sets
this to its max_concurrency so download concurrency keeps
doubling toward the ceiling instead of crawling +1 per window —
additive growth simply cannot reach a useful cap on a
fast-but-lossy link before the file finishes. See
AdaptiveController::new.
latency_decrease_enabled: boolWhen false, the p95-latency-vs-baseline comparison never
triggers a Decrease (it still updates the baseline). The fetch
channel disables it because chunk_get’s observed latency
includes the internal retry sleep and slow retry-sweep for the
chunks that needed one, so a window with a couple of retry-path
chunks has a wildly inflated p95 that is retry variance, not
congestion. Genuine fetch congestion still surfaces as a rising
Ok(None) (Timeout) rate, which the timeout_ceiling check
catches.
Trait Implementations§
Source§impl Clone for LimiterConfig
impl Clone for LimiterConfig
Source§fn clone(&self) -> LimiterConfig
fn clone(&self) -> LimiterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LimiterConfig
impl RefUnwindSafe for LimiterConfig
impl Send for LimiterConfig
impl Sync for LimiterConfig
impl Unpin for LimiterConfig
impl UnsafeUnpin for LimiterConfig
impl UnwindSafe for LimiterConfig
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> 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>
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>
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