Skip to content

Commit eee5cab

Browse files
authored
increased quic connection timeout (#29)
* increased quic connection timeout and keep_alive interval to reduce ping traffic overhead * keep QUIC_KEEP_ALIVE for now
1 parent f93ad76 commit eee5cab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

quic-definitions/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ pub const QUIC_TOTAL_STAKED_CONCURRENT_STREAMS: usize = 100_000;
1616
// forwarded packets from staked nodes.
1717
pub const QUIC_MAX_STAKED_CONCURRENT_STREAMS: usize = 512;
1818

19-
pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(2);
19+
/// QUIC connection idle timeout. The connection will be closed if
20+
/// there are no activities on it within the timeout window.
21+
pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(60);
22+
23+
/// To avoid idle timeout, the QUIC endpoint sends a ping every
24+
/// QUIC_KEEP_ALIVE. This shouldn't be too low to avoid unnecessary ping traffic.
25+
/// For upgrade purpose, we keep the original one. Once the network is upgraded
26+
/// to the one having higher QUIC_MAX_TIMEOUT, this value can be increased.
2027
pub const QUIC_KEEP_ALIVE: Duration = Duration::from_secs(1);
2128

2229
// Disable Quic send fairness.

0 commit comments

Comments
 (0)