Skip to content

Commit

Permalink
Reduce max staked streams count to avoid fragmentations (solana-labs#…
Browse files Browse the repository at this point in the history
…32771)

Reduce max staked concurrent streams to 512 from 2048.
  • Loading branch information
lijunwangs committed Aug 15, 2023
1 parent 0de8ccf commit b44c9bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sdk/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ pub const QUIC_MIN_STAKED_CONCURRENT_STREAMS: usize = 128;

pub const QUIC_TOTAL_STAKED_CONCURRENT_STREAMS: usize = 100_000;

// Set the maximum concurrent stream numbers to avoid excessive streams
pub const QUIC_MAX_STAKED_CONCURRENT_STREAMS: usize = 2048;
// Set the maximum concurrent stream numbers to avoid excessive streams.
// The value was lowered from 2048 to reduce contention of the limited
// receive_window among the streams which is observed in CI bench-tests with
// forwarded packets from staked nodes.
pub const QUIC_MAX_STAKED_CONCURRENT_STREAMS: usize = 512;

pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(2);
pub const QUIC_KEEP_ALIVE: Duration = Duration::from_secs(1);
Expand Down
3 changes: 2 additions & 1 deletion streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,8 @@ pub mod test {
);
assert_eq!(
compute_max_allowed_uni_streams(ConnectionPeerType::Staked, 100, 10000),
(delta / (100_f64)) as usize + QUIC_MIN_STAKED_CONCURRENT_STREAMS
((delta / (100_f64)) as usize + QUIC_MIN_STAKED_CONCURRENT_STREAMS)
.min(QUIC_MAX_STAKED_CONCURRENT_STREAMS)
);
assert_eq!(
compute_max_allowed_uni_streams(ConnectionPeerType::Staked, 0, 10000),
Expand Down

0 comments on commit b44c9bc

Please sign in to comment.