java.lang.Object
net.i2p.router.Tuner.BaseParam
net.i2p.router.Tuner.MaxInboundBufferParam
- All Implemented Interfaces:
Tuner.TunableParam
- Enclosing class:
Tuner
Per-connection inbound buffer cap (bytes). Raise when choke pressure is high (receiver can't keep up) or retransmissions are frequent (more in-flight capacity needed). Lower when memory pressure is high.
Field Summary
Fields inherited from class Tuner.BaseParam
_autotune, _autoTuning, _cpuDriven, _ctx, _defaultMax, _defaultMin, _defaultStep, _defaultValue, _description, _effMax, _factoryDefault, _firstTick, _health, _historyCount, _initialValue, _log, _max, _min, _name, _override, _propPrefix, _statHistory, _statName, _step, _subsystem, _valueHistory, sharedAutotuneModifier and TypeFieldDescriptionprotected final Tuner.AutotuneConfigAutotune profile for this tunable parameter.protected booleanWhether autotuning is active for this parameter.protected booleanWhether this param's value is being driven by CPU load rather than its own stat.protected final RouterContextRouter context.protected final intDefault maximum value from code or config.protected final intDefault minimum value from code or config.protected final intDefault step/increment size for adjustments.protected intFactory default: value before any tuning.protected final StringHuman-readable label for display in the Tuner UI.protected intEffective ceiling = min(_max, memory-derived bound); never exceeds _max.protected final intCode-level default captured at construction time.protected booleanTrue until firstTuner.BaseParam.update()call — applies persisted value from autotune.config.protected Tuner.SystemHealthHealth score and subsystem for autotune decisions.protected intNumber of valid entries in _valueHistory / _statHistory.protected final intLast known value (from persistence or runtime default).protected final LogClass logger.protected intCurrent maximum value (may differ from default after tuning).protected intCurrent minimum value (may differ from default after tuning).protected final StringInternal config property key (e.g.protected intUser-set override value, or Integer.MIN_VALUE if unset.protected final StringConfig key prefix for property lookups.protected final double[]Rolling window of recent stat values for trend analysis.protected final StringRouter stat name for observed value feedback.protected intCurrent step/increment size (may differ from default).protected final StringSubsystem identifier this parameter belongs to.protected final int[]Rolling window of recent tunable values for trend analysis.(package private) static Tuner.AutotuneConfigShared instance — set once in Tuner constructor, used by all BaseParams.Constructor Summary
ConstructorsConstructorDescriptionCreates the parameter that tunes the streaming inbound buffer cap in bytes.Method Summary
All MethodsModifier and TypeMethodDescriptionprotected voidapplyValue(int value) Apply the cap via I2PSocketManagerFull.protected intcomputeTarget(double observed) Compute target based on choke pressure, retransmissions, and memory pressure.protected doubleObserved stat: choke activations per 60s window.protected intRead current cap from I2PSocketManagerFull.Methods inherited from class Tuner.BaseParam
clamp, decisionReason, getAdditionalEventCount, getAdditionalEventCountHourly, getAdditionalStat, getAdditionalStat5Min, getAdditionalStatHourly, getAdditionalStatLong, getBuildSuccessRate, getCoDelDropEventCount, getCurrentValue, getDefaultMax, getDefaultMin, getDefaultStep, getDefaultValue, getDescription, getHeavyTransitThreshold, getMax, getMessageReceiverUtilization, getMin, getName, getObservedRTT, getPacketHandlerUtilization, getPumperUtilization, getReaderUtilization, getSendFinisherUtilization, getShareBps, getStatHistory, getStatPeriodStamp, getStep, getStreamingLossRate, getSubsystem, getSustainedHeavyTransitThreshold, getValueHistory, getWriterUtilization, isAutoTuning, persistValue, reclaimIfIdle, recordHistory, refreshDefault, refreshRanges, setHealth, setOverride, signalIsFresh, snapshot, updateModifier and TypeMethodDescriptionprotected static intclamp(int current, int target, int step) Move from current toward target, but at most one step per cycle.protected StringWhy the current target was chosen, for the change line.protected doublegetAdditionalEventCount(RouterContext ctx, String statName) Fetch the event count for an additional stat using the 60s period.protected doublegetAdditionalEventCountHourly(RouterContext ctx, String statName) Fetch the event count for an additional stat using the 1-hour period.protected doublegetAdditionalStat(RouterContext ctx, String statName) Fetch an additional stat value for cross-reference decisions.protected doublegetAdditionalStat5Min(RouterContext ctx, String statName) Fetch an additional stat value using the 5-minute average.protected doublegetAdditionalStatHourly(RouterContext ctx, String statName) Fetch an additional stat value using the 1-hour average.protected doublegetAdditionalStatLong(RouterContext ctx, String statName) Fetch an additional stat value using the 10-minute average.protected doubleCompute actual tunnel build success rate from event counts.protected doublegetCoDelDropEventCount(RouterContext ctx, String prefix) Fetch the total CoDel drop event count across all priority levels.intThe value in effect right now.protected intEffective default max — override for bandwidth-scaled params.protected intEffective default min — override for bandwidth-scaled params.protected intEffective default step — override for bandwidth-scaled params.intDefault value.Param description.protected static intTransit bandwidth threshold for "heavy" — 80% of configured share bandwidth.intgetMax()Maximum value.protected doubleUDP message receiver pool utilization (0.0-1.0).intgetMin()Minimum value.getName()Param name.protected doublegetObservedRTT(RouterContext ctx, String primaryStat) Fetch observed RTT, falling back toudp.sendConfirmTimewhen the primary stat has no events (lightly loaded router).protected doubleUDP packet handler pool utilization (0.0-1.0).protected doubleTunnel pumper pool utilization (0.0-1.0).protected doubleNTCP reader pool utilization (0.0-1.0).protected doubleNTCP send finisher pool utilization (0.0-1.0).protected static intgetShareBps(RouterContext ctx) Current share bandwidth in bytes per second.double[]Rolling window of recent stat values.protected doublegetStatPeriodStamp(RouterContext ctx, String statName) When the window behind a stat's event count last completed, in ms, or NaN when it cannot be determined.intgetStep()Step size.protected doubleRecent streaming retransmission rate for this tuning cycle.Subsystem name.protected static intTransit bandwidth threshold for "sustained heavy" — 50% of configured share.int[]Rolling window of recent tunable values.protected doubleNTCP writer pool utilization (0.0-1.0).booleanWhether auto-tuning is enabled.protected voidpersistValue(RouterContext ctx, int value) Persist a tuned value to autotune.config.protected static intreclaimIfIdle(double utilization, int current, int min, double idleThreshold) Reclaim parked threads from a thread pool that is massively under-utilized.protected voidrecordHistory(double observed) Record history.voidRe-read the default value from autotune.config for live updates.voidRe-read min/max/step from autotune.config — live update, no restart.(package private) voidsetHealth(Tuner.SystemHealth health) The current system health score for this update cycle.voidsetOverride(int value) A manual override value.(package private) static booleansignalIsFresh(double periodStamp, double lastStamp) Whether a signal reading is from a window that closed since the stored stamp.snapshot()Capture snapshot of current tunable state for display.voidupdate()Main tuning loop for this param.
Constructor Details
MaxInboundBufferParam
MaxInboundBufferParam()Creates the parameter that tunes the streaming inbound buffer cap in bytes.
Method Details
applyValue
protected void applyValue(int value) Apply the cap via I2PSocketManagerFull.- Specified by:
applyValuein classTuner.BaseParam- Parameters:
value- the tunable value to apply to router configuration
getRuntimeValue
protected int getRuntimeValue()Read current cap from I2PSocketManagerFull.- Specified by:
getRuntimeValuein classTuner.BaseParam- Returns:
- current runtime value read from router config
getObservedStat
Observed stat: choke activations per 60s window.- Specified by:
getObservedStatin classTuner.BaseParam- Parameters:
ctx- router context, never null- Returns:
- observed stat value for autotuning
computeTarget
protected int computeTarget(double observed) Compute target based on choke pressure, retransmissions, and memory pressure.- Specified by:
computeTargetin classTuner.BaseParam- Parameters:
observed- current stat value- Returns:
- target tunable value