diff --git a/implementations/rust/ockam/ockam_api/tests/portals.rs b/implementations/rust/ockam/ockam_api/tests/portals.rs index d1b0ab9d1e6..b86a303bfc8 100644 --- a/implementations/rust/ockam/ockam_api/tests/portals.rs +++ b/implementations/rust/ockam/ockam_api/tests/portals.rs @@ -223,12 +223,12 @@ fn portal_node_goes_down_reconnect() { #[test] fn portal_low_bandwidth_connection_keep_working_for_60s() { // in this test we use two nodes, connected through a passthrough server - // which limits the bandwidth to 64kb per second + // which limits the bandwidth to 170kb per second // // ┌────────┐ ┌───────────┐ ┌────────┐ // │ Node └─────► TCP └────────► Node │ // │ 1 ◄─────┐Passthrough◄────────┐ 2 │ - // └────┬───┘ │ 64KB/s │ └────▲───┘ + // └────┬───┘ │ 170KB/s │ └────▲───┘ // │ └───────────┘ │ // │ ┌───────────┐ │ // │ Portal │ TCP │ Outlet │ @@ -270,8 +270,8 @@ fn portal_low_bandwidth_connection_keep_working_for_60s() { let passthrough_server_handle = start_passthrough_server( &second_node_listen_address.to_string(), - Disruption::LimitBandwidth(64 * 1024), - Disruption::LimitBandwidth(64 * 1024), + Disruption::LimitBandwidth(170 * 1024), + Disruption::LimitBandwidth(170 * 1024), ) .await; diff --git a/implementations/rust/ockam/ockam_transport_tcp/src/portal/portal_message.rs b/implementations/rust/ockam/ockam_transport_tcp/src/portal/portal_message.rs index 6c2ba0fb5b0..603d8844d4d 100644 --- a/implementations/rust/ockam/ockam_transport_tcp/src/portal/portal_message.rs +++ b/implementations/rust/ockam/ockam_transport_tcp/src/portal/portal_message.rs @@ -108,7 +108,7 @@ pub enum PortalInternalMessage { } /// Maximum allowed size for a payload -pub const MAX_PAYLOAD_SIZE: usize = 48 * 1024; +pub const MAX_PAYLOAD_SIZE: usize = 128 * 1024; #[cfg(test)] mod test { diff --git a/tools/stress-test/src/portal_simulator.rs b/tools/stress-test/src/portal_simulator.rs index 7194610dd9d..93ea4aa0c30 100644 --- a/tools/stress-test/src/portal_simulator.rs +++ b/tools/stress-test/src/portal_simulator.rs @@ -13,6 +13,8 @@ use ockam_multiaddr::MultiAddr; use crate::config::Throughput; +pub const MAX_PAYLOAD_SIZE: usize = 128 * 1024; + pub struct PortalStats { pub messages_out_of_order: Arc, pub bytes_received: Arc, @@ -97,7 +99,7 @@ impl Processor for PortalSimulatorSender { while bytes_left > 0 { let next_message_number = self.messages_sent.fetch_add(1, Ordering::Relaxed); - let payload_size = std::cmp::min(bytes_left, 48 * 1024); + let payload_size = std::cmp::min(bytes_left, MAX_PAYLOAD_SIZE); let mut message = Vec::with_capacity(8 + 8 + payload_size); message.extend_from_slice(&next_message_number.to_le_bytes());