forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 936
Tweak open connection limits for unstaked connections #6953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lijunwangs
wants to merge
8
commits into
anza-xyz:master
Choose a base branch
from
lijunwangs:adjust_connection_count
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e42da5b
Tweak open connection limits for unstaked connections
lijunwangs 9c639aa
Changed DEFAULT_MAX_UNSTAKED_CONNECTIONS_PER_IPADDR to 4
lijunwangs 070c73a
tweak max_unstaked_connections_per_ipaddr for test
lijunwangs 50d9f62
Tweak max unstaked connection per ipaddr for test
lijunwangs bb0e689
Tweak max unstaked connection per ipaddr for test
lijunwangs 05f4208
Increase unstaked connection stream percentage to 50
lijunwangs 36cd6ac
Update test based on the percentage change
lijunwangs 6c35787
Update test based on the percentage change
lijunwangs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,11 @@ pub const DEFAULT_MAX_QUIC_CONNECTIONS_PER_PEER: usize = 8; | |
|
|
||
| pub const DEFAULT_MAX_STAKED_CONNECTIONS: usize = 2000; | ||
|
|
||
| pub const DEFAULT_MAX_UNSTAKED_CONNECTIONS: usize = 500; | ||
| /// The maximum number of connections that can be opened for unstaked peers. | ||
| pub const DEFAULT_MAX_UNSTAKED_CONNECTIONS: usize = 2000; | ||
|
|
||
| /// The maximum number of connections that can be opened for unstaked peers. | ||
| pub const DEFAULT_MAX_UNSTAKED_CONNECTIONS_PER_IPADDR: usize = 4; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this change be in a separate PR? |
||
|
|
||
| /// Limit to 500K PPS | ||
| pub const DEFAULT_MAX_STREAMS_PER_MS: u64 = 500; | ||
|
|
@@ -622,6 +626,7 @@ pub fn spawn_server_multi( | |
| #[derive(Clone)] | ||
| pub struct QuicServerParams { | ||
| pub max_connections_per_peer: usize, | ||
| pub max_unstaked_connections_per_ipaddr: usize, | ||
| pub max_staked_connections: usize, | ||
| pub max_unstaked_connections: usize, | ||
| pub max_streams_per_ms: u64, | ||
|
|
@@ -637,6 +642,7 @@ impl Default for QuicServerParams { | |
| QuicServerParams { | ||
| max_connections_per_peer: 1, | ||
| max_staked_connections: DEFAULT_MAX_STAKED_CONNECTIONS, | ||
| max_unstaked_connections_per_ipaddr: DEFAULT_MAX_UNSTAKED_CONNECTIONS_PER_IPADDR, | ||
| max_unstaked_connections: DEFAULT_MAX_UNSTAKED_CONNECTIONS, | ||
| max_streams_per_ms: DEFAULT_MAX_STREAMS_PER_MS, | ||
| max_connections_per_ipaddr_per_min: DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE, | ||
|
|
@@ -658,6 +664,7 @@ impl QuicServerParams { | |
| Self { | ||
| coalesce_channel_size: 100_000, | ||
| num_threads: Self::DEFAULT_NUM_SERVER_THREADS_FOR_TEST, | ||
| max_unstaked_connections_per_ipaddr: 1, | ||
| ..Self::default() | ||
| } | ||
| } | ||
|
|
@@ -841,6 +848,7 @@ mod test { | |
| staked_nodes, | ||
| QuicServerParams { | ||
| max_connections_per_peer: 2, | ||
| max_unstaked_connections_per_ipaddr: 2, | ||
| ..QuicServerParams::default_for_tests() | ||
| }, | ||
| cancel.clone(), | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really should not be changing this here. This is completely unrelated change and will not have the impact you intend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using the connection count to distribute the streams/s to different connections out of the total streams/s allowed. With increased connection count quadrupled, the per connection TPS for unstaked, can be reduced to 1/4. The increased percentage reduces that effect.
Our allocation of staked vs. unstaked does not reflect the real usage in MB:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does, but it also cuts massively into the staked TPU bandwidth allocations, reducing them. Not sure that is desirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The staked is not using the allocated bandwidth. See the max. Even 50% --> 250K/s should be more than enough for them to use realistically.