Skip to main content

Module aimd

Module aimd 

Source
Expand description

AIMD (Additive Increase / Multiplicative Decrease) rate controller.

This module provides a reusable AIMD algorithm for dynamically adjusting request rates. On success windows, the rate increases additively. On windows with throttle signals, the rate decreases multiplicatively.

The algorithm operates in discrete time windows. At the end of each window, the throttle ratio (throttled / total) is compared against a threshold:

  • Above threshold: rate = max(rate * decrease_factor, min_rate)
  • At or below threshold: rate = min(rate + additive_increment, max_rate)

Structs§

AimdConfig
Configuration for the AIMD rate controller.
AimdController
AIMD rate controller.

Enums§

RequestOutcome
Outcome of a single request, used to feed the AIMD controller.