diff --git a/streamer/src/nonblocking/stream_throttle.rs b/streamer/src/nonblocking/stream_throttle.rs index e773b5f816725c..03818e09460d5c 100644 --- a/streamer/src/nonblocking/stream_throttle.rs +++ b/streamer/src/nonblocking/stream_throttle.rs @@ -21,8 +21,19 @@ pub const STREAM_THROTTLING_INTERVAL_MS: u64 = 100; pub const STREAM_THROTTLING_INTERVAL: Duration = Duration::from_millis(STREAM_THROTTLING_INTERVAL_MS); const STREAM_LOAD_EMA_INTERVAL_MS: u64 = 5; +<<<<<<< HEAD const STREAM_LOAD_EMA_INTERVAL_COUNT: u64 = 10; const EMA_WINDOW_MS: u64 = STREAM_LOAD_EMA_INTERVAL_MS * STREAM_LOAD_EMA_INTERVAL_COUNT; +======= +// EMA smoothing window to reduce sensitivity to short-lived load spikes at the start +// of a leader slot. Throttling is only triggered when saturation is sustained. +// The value 40 was chosen based on simulations: at a max target TPS of ~400K, +// it allows the system to absorb a burst of ~50K transactions over ~40 ms +// before throttling activates. +const STREAM_LOAD_EMA_INTERVAL_COUNT: u64 = 40; + +const STAKED_THROTTLING_ON_LOAD_THRESHOLD_PERCENT: u64 = 95; +>>>>>>> 51ebbc43a (Increase the duration of the EMA smoothing window (STREAM_LOAD_EMA_INTERVAL_COUNT) (#10033)) pub(crate) struct StakedStreamLoadEMA { current_load_ema: AtomicU64,