java.lang.Object
net.i2p.router.Tuner.BaseParam
net.i2p.router.Tuner.I2PTunnelServerBacklogParam
All Implemented Interfaces:
Tuner.TunableParam
Enclosing class:
Tuner

private class Tuner.I2PTunnelServerBacklogParamextends Tuner.BaseParam
Tunes the number of inbound connections that may wait in the I2PTunnel server handler bounded queue before overflow rejection. A larger buffer absorbs bursts without closing connections, at the cost of holding an I2PSocket per queued task; too small a buffer rejects connections under load even though the handler pool is not yet saturated.

Policy: grow toward the ceiling as the observed backlog (queueDepth, 60s avg) approaches the current capacity, grow a little when backlog >50 but still clear of the cap and no CPU pressure, and shrink back toward the floor when the backlog is consistently near-empty.

  • Constructor Details

    • I2PTunnelServerBacklogParam

      I2PTunnelServerBacklogParam()
      Creates the parameter that tunes the I2PTunnel server queue capacity.
  • Method Details

    • applyValue

      protected void applyValue(int value)
      Description copied from class: Tuner.BaseParam
      Apply the tunable value to the router configuration.
      Specified by:
      applyValue in class Tuner.BaseParam
      Parameters:
      value - the tunable value to apply to router configuration
    • getRuntimeValue

      protected int getRuntimeValue()
      Description copied from class: Tuner.BaseParam
      Current runtime value read from the router configuration.
      Specified by:
      getRuntimeValue in class Tuner.BaseParam
      Returns:
      current runtime value read from router config
    • getObservedStat

      protected double getObservedStat(RouterContext ctx)
      Read the live aggregate queue depth across all server tunnel pools. Bypasses the 60s Rate average for instant saturation detection.
      Specified by:
      getObservedStat in class Tuner.BaseParam
      Parameters:
      ctx - router context, never null
      Returns:
      observed stat value for autotuning
    • computeTarget

      protected int computeTarget(double observed)
      Description copied from class: Tuner.BaseParam
      Target tunable value computed from the observed stat.
      Specified by:
      computeTarget in class Tuner.BaseParam
      Parameters:
      observed - current stat value
      Returns:
      target tunable value