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§
- Aimd
Config - Configuration for the AIMD rate controller.
- Aimd
Controller - AIMD rate controller.
Enums§
- Request
Outcome - Outcome of a single request, used to feed the AIMD controller.