Class VeniceAdaptiveBlobTransferTrafficThrottler

java.lang.Object
com.linkedin.davinci.blobtransfer.VeniceAdaptiveBlobTransferTrafficThrottler
All Implemented Interfaces:
VeniceAdaptiveThrottler

public class VeniceAdaptiveBlobTransferTrafficThrottler extends Object implements VeniceAdaptiveThrottler
Adaptive throttling wrapper for GlobalChannelTrafficShapingHandler that dynamically tunes global read or write limits for blob transfer based on registered boolean signals. It controls either global read or write throughput for the blob transfer behavior based on results of the registered limiter and booster signals. The heuristic behavior rules are defined as: (1) If any limiter signal found, it will decrease by 20%. (min 20% of the base rate). (2) If no limiter signal found, but there is booster signal found, it will increase by 20%. (max 200% of the base rate). (3) If none of the above rule applies, it will increase idle count, if idle count is greater than the pre-defined threshold, it will try to increase by 20% (still max 200% of the base rate). Base rate is initially set to ConfigKeys.BLOB_TRANSFER_SERVICE_WRITE_LIMIT_BYTES_PER_SEC or ConfigKeys.BLOB_TRANSFER_CLIENT_READ_LIMIT_BYTES_PER_SEC and will be adjusted based on input signals dynamically.
  • Constructor Details

    • VeniceAdaptiveBlobTransferTrafficThrottler

      public VeniceAdaptiveBlobTransferTrafficThrottler(int singleIdleThreshold, long baseRate, int rateUpdatePercentage, boolean isWriteThrottler)
  • Method Details

    • registerLimiterSignal

      public void registerLimiterSignal(BooleanSupplier supplier)
      Description copied from interface: VeniceAdaptiveThrottler
      Registers a limiter signal supplier that, when evaluated to true, indicates that the throttler should reduce its throughput rate.
      Specified by:
      registerLimiterSignal in interface VeniceAdaptiveThrottler
      Parameters:
      supplier - a BooleanSupplier providing the limiter signal.
    • registerBoosterSignal

      public void registerBoosterSignal(BooleanSupplier supplier)
      Description copied from interface: VeniceAdaptiveThrottler
      Registers a booster signal supplier that, when evaluated to true, indicates that the throttler may safely increase its throughput rate.
      Specified by:
      registerBoosterSignal in interface VeniceAdaptiveThrottler
      Parameters:
      supplier - a BooleanSupplier providing the booster signal.
    • checkSignalAndAdjustThrottler

      public void checkSignalAndAdjustThrottler()
      Description copied from interface: VeniceAdaptiveThrottler
      Evaluates all registered limiter and booster signals, and adjusts the throttler’s rate accordingly. The exact adjustment strategy is defined by the implementation.
      Specified by:
      checkSignalAndAdjustThrottler in interface VeniceAdaptiveThrottler
    • getCurrentThrottlerRate

      public long getCurrentThrottlerRate()
      Description copied from interface: VeniceAdaptiveThrottler
      Returns the current effective throttler rate after adaptive adjustments.
      Specified by:
      getCurrentThrottlerRate in interface VeniceAdaptiveThrottler
      Returns:
      the current throttling rate, typically represented in operations per second or another unit defined by the implementation.
    • getThrottlerName

      public String getThrottlerName()
      Description copied from interface: VeniceAdaptiveThrottler
      Returns a human-readable name for this throttler instance.

      This is useful for logging, debugging, or monitoring purposes when multiple throttlers are in use.

      Specified by:
      getThrottlerName in interface VeniceAdaptiveThrottler
      Returns:
      the throttler’s name.
    • setGlobalChannelTrafficShapingHandler

      public void setGlobalChannelTrafficShapingHandler(io.netty.handler.traffic.GlobalChannelTrafficShapingHandler globalChannelTrafficShapingHandler)