-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Network] Adding AptosPerf Client #6054
Changes from all commits
df4419f
d839d6d
719cdf4
e510fe7
3f59da9
311fdfc
8c014b3
734450d
9f1fdd4
ae4c338
b03e6f3
347022b
6d3f4b4
21702ec
f1b0f98
c35bbc3
60c486d
1bab4fe
b7c0c01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,10 +434,12 @@ impl NodeConfig { | |
|
||
if let Some(network) = self.validator_network.as_mut() { | ||
network.listen_address = crate::utils::get_available_port_in_multiaddr(true); | ||
network.randomize_ports(); | ||
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. nit: can you also move the randomization of the |
||
} | ||
|
||
for network in self.full_node_networks.iter_mut() { | ||
network.listen_address = crate::utils::get_available_port_in_multiaddr(true); | ||
network.randomize_ports(); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ pub const INBOUND_TCP_RX_BUFFER_SIZE: u32 = 3 * 1024 * 1024; // 3MB ~6MB/s with | |
pub const INBOUND_TCP_TX_BUFFER_SIZE: u32 = 512 * 1024; // 1MB use a bigger spoon | ||
pub const OUTBOUND_TCP_RX_BUFFER_SIZE: u32 = 3 * 1024 * 1024; // 3MB ~6MB/s with 500ms latency | ||
pub const OUTBOUND_TCP_TX_BUFFER_SIZE: u32 = 1024 * 1024; // 1MB use a bigger spoon | ||
pub const ENABLE_APTOS_NETPERF_CLIENT: bool = true; | ||
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. This should be disabled by default, no? |
||
pub const DEFAULT_APTOS_NETPERF_CLIENT_PORT: u16 = 9105; | ||
|
||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] | ||
#[serde(default, deny_unknown_fields)] | ||
|
@@ -80,6 +82,7 @@ pub struct NetworkConfig { | |
// Select this to enforce that both peers should authenticate each other, otherwise | ||
// authentication only occurs for outgoing connections. | ||
pub mutual_authentication: bool, | ||
pub netperf_client_port: Option<u16>, | ||
pub network_id: NetworkId, | ||
pub runtime_threads: Option<usize>, | ||
pub inbound_rx_buffer_size_bytes: Option<u32>, | ||
|
@@ -120,7 +123,19 @@ impl Default for NetworkConfig { | |
} | ||
} | ||
|
||
fn netperf_client_port(enabled: bool) -> Option<u16> { | ||
if enabled { | ||
Some(DEFAULT_APTOS_NETPERF_CLIENT_PORT) | ||
} else { | ||
None | ||
} | ||
} | ||
|
||
impl NetworkConfig { | ||
pub fn randomize_ports(&mut self) { | ||
self.netperf_client_port = Some(utils::get_available_port()); | ||
} | ||
|
||
pub fn network_with_id(network_id: NetworkId) -> NetworkConfig { | ||
let mutual_authentication = network_id.is_validator_network(); | ||
let mut config = Self { | ||
|
@@ -129,6 +144,7 @@ impl NetworkConfig { | |
identity: Identity::None, | ||
listen_address: "/ip4/0.0.0.0/tcp/6180".parse().unwrap(), | ||
mutual_authentication, | ||
netperf_client_port: netperf_client_port(ENABLE_APTOS_NETPERF_CLIENT), | ||
network_id, | ||
runtime_threads: None, | ||
seed_addrs: HashMap::new(), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,7 @@ impl<K: Eq + Hash + Clone, T> PerKeyQueue<K, T> { | |
// For example, many of our queues have a max capacity of 1024. To | ||
// handle a single rpc from a transient peer, we would end up | ||
// allocating ~ 96 b * 1024 ~ 64 Kib per queue. | ||
//TODO: Reconsider this. Maybe true for VFN but not Validators | ||
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. nit: space after |
||
.or_insert_with(|| VecDeque::with_capacity(1)); | ||
|
||
// Add the key to our round-robin queue if it's not already there | ||
|
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.
Any reason we chose
axum
overhyper
? I see that it's used by thehttp_test
, but I'm just wondering why we didn't choose to reusehyper
given that all of our other services use it.