Class StabilizingAIMDLimit

java.lang.Object
com.netflix.concurrency.limits.limit.AbstractLimit
io.camunda.zeebe.logstreams.impl.flowcontrol.StabilizingAIMDLimit
All Implemented Interfaces:
com.netflix.concurrency.limits.Limit

public final class StabilizingAIMDLimit extends com.netflix.concurrency.limits.limit.AbstractLimit
The limit is calculated purely based on the configured expectedRTT and observed rtt (round trip time). The algorithm tries to keep the rtts around expectedRTT. It is not guaranteed to be always less than that. But on an average, rtts will be less than the configured expectedRTT.

The implementation is based on AIMDLimit. AIMDLimit has a limitation that the limit fluctuates between 1 and 2*X, where X is the optimal limit for the system. It rarely stabilizes at X. This results in always fluctuating throughput and latency. StabilizingAIMDLimit fixes this issue, by not reducing the limit if the inflight is greater than the current limit. As a result it attempts to keep the limit around X.

  • Method Details

    • _update

      protected int _update(long startTime, long rtt, int inflight, boolean didDrop)
      Specified by:
      _update in class com.netflix.concurrency.limits.limit.AbstractLimit
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newBuilder

      public static StabilizingAIMDLimit.Builder newBuilder()