Created
March 19, 2026 18:02
-
-
Save alexpyattaev/90cf4bcc75287704b0ebe93805af8275 to your computer and use it in GitHub Desktop.
Disables all rate limiting in agave streamer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/streamer/src/nonblocking/quic.rs | |
| +++ b/streamer/src/nonblocking/quic.rs | |
| @@ -76,10 +76,10 @@ | |
| /// Total new connection counts per second. Heuristically taken from | |
| /// the default staked and unstaked connection limits. Might be adjusted | |
| /// later. | |
| -const TOTAL_CONNECTIONS_PER_SECOND: f64 = 2500.0; | |
| +const TOTAL_CONNECTIONS_PER_SECOND: f64 = 25000.0; | |
| /// Max burst of connections above sustained rate to pass through | |
| -const MAX_CONNECTION_BURST: u64 = 1000; | |
| +const MAX_CONNECTION_BURST: u64 = 5000; | |
| /// Timeout for connection handshake. Timer starts once we get Initial from the | |
| /// peer, and is canceled when we get a Handshake packet from them. | |
| @@ -468,32 +468,32 @@ | |
| // now that we have observed the handshake we can be certain | |
| // that the initiator owns an IP address, we can update rate | |
| // limiters on the server | |
| - if !rate_limiter.register_connection(&from.ip()) { | |
| - debug!("Reject connection from {from:?} -- rate limiting exceeded"); | |
| - stats | |
| - .connection_rate_limited_per_ipaddr | |
| - .fetch_add(1, Ordering::Relaxed); | |
| - new_connection.close( | |
| - CONNECTION_CLOSE_CODE_DISALLOWED.into(), | |
| - CONNECTION_CLOSE_REASON_DISALLOWED, | |
| - ); | |
| - return; | |
| - } | |
| - | |
| - if overall_connection_rate_limiter.consume_tokens(1).is_err() { | |
| - debug!( | |
| - "Reject connection from {:?} -- total rate limiting exceeded", | |
| - from.ip() | |
| - ); | |
| - stats | |
| - .connection_rate_limited_across_all | |
| - .fetch_add(1, Ordering::Relaxed); | |
| - new_connection.close( | |
| - CONNECTION_CLOSE_CODE_DISALLOWED.into(), | |
| - CONNECTION_CLOSE_REASON_DISALLOWED, | |
| - ); | |
| - return; | |
| - } | |
| + // if !rate_limiter.register_connection(&from.ip()) { | |
| + // debug!("Reject connection from {from:?} -- rate limiting exceeded"); | |
| + // stats | |
| + // .connection_rate_limited_per_ipaddr | |
| + // .fetch_add(1, Ordering::Relaxed); | |
| + // new_connection.close( | |
| + // CONNECTION_CLOSE_CODE_DISALLOWED.into(), | |
| + // CONNECTION_CLOSE_REASON_DISALLOWED, | |
| + // ); | |
| + // return; | |
| + // } | |
| + | |
| + // if overall_connection_rate_limiter.consume_tokens(1).is_err() { | |
| + // debug!( | |
| + // "Reject connection from {:?} -- total rate limiting exceeded", | |
| + // from.ip() | |
| + // ); | |
| + // stats | |
| + // .connection_rate_limited_across_all | |
| + // .fetch_add(1, Ordering::Relaxed); | |
| + // new_connection.close( | |
| + // CONNECTION_CLOSE_CODE_DISALLOWED.into(), | |
| + // CONNECTION_CLOSE_REASON_DISALLOWED, | |
| + // ); | |
| + // return; | |
| + // } | |
| stats.total_new_connections.fetch_add(1, Ordering::Relaxed); | |
| --- a/streamer/src/nonblocking/stream_throttle.rs | |
| +++ b/streamer/src/nonblocking/stream_throttle.rs | |
| @@ -15,7 +15,7 @@ | |
| }; | |
| /// Max TPS allowed for unstaked connection | |
| -const MAX_UNSTAKED_TPS: u64 = 200; | |
| +const MAX_UNSTAKED_TPS: u64 = 200000; | |
| /// Expected % of max TPS to be consumed by unstaked connections | |
| const EXPECTED_UNSTAKED_STREAMS_PERCENT: u64 = 20; | |
| --- a/streamer/src/quic.rs | |
| +++ b/streamer/src/quic.rs | |
| @@ -39,14 +39,14 @@ | |
| pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(30); | |
| // allow multiple connections for NAT and any open/close overlap | |
| -pub const DEFAULT_MAX_QUIC_CONNECTIONS_PER_UNSTAKED_PEER: usize = 8; | |
| +pub const DEFAULT_MAX_QUIC_CONNECTIONS_PER_UNSTAKED_PEER: usize = 256; | |
| // allow multiple connections per ID for geo-distributed forwarders | |
| -pub const DEFAULT_MAX_QUIC_CONNECTIONS_PER_STAKED_PEER: usize = 16; | |
| +pub const DEFAULT_MAX_QUIC_CONNECTIONS_PER_STAKED_PEER: usize = 256; | |
| -pub const DEFAULT_MAX_STAKED_CONNECTIONS: usize = 2000; | |
| +pub const DEFAULT_MAX_STAKED_CONNECTIONS: usize = 8000; | |
| -pub const DEFAULT_MAX_UNSTAKED_CONNECTIONS: usize = 2000; | |
| +pub const DEFAULT_MAX_UNSTAKED_CONNECTIONS: usize = 8000; | |
| /// Limit to 500K PPS | |
| pub const DEFAULT_MAX_STREAMS_PER_MS: u64 = 500; | |
| @@ -54,7 +54,7 @@ | |
| /// The new connections per minute from a particular IP address. | |
| /// Heuristically set to the default maximum concurrent connections | |
| /// per IP address. Might be adjusted later. | |
| -pub const DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE: u64 = 8; | |
| +pub const DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE: u64 = 128; | |
| // This will be adjusted and parameterized in follow-on PRs. | |
| pub const DEFAULT_QUIC_ENDPOINTS: usize = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment