Skip to content
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

Adding configurabele TCP buffers and minor hafixes #4649

Merged
merged 5 commits into from
Oct 11, 2022
Merged

Conversation

Markuze
Copy link
Contributor

@Markuze Markuze commented Sep 29, 2022

  • [Network] set socket RX/TX Buffers

Adding configurable TCP buffers for inbound and outbound TCP connections.
This change will improve networking performance, especially for long RTT connections.

Description

Test Plan


This change is Reviewable

@Markuze Markuze requested a review from a team as a code owner September 29, 2022 19:20
@Markuze Markuze requested review from zekun000, grao1991 and igor-aptos and removed request for a team September 29, 2022 19:42
@Markuze Markuze added the CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR label Sep 29, 2022
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Contributor

@JoshLind JoshLind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @Markuze

@@ -51,6 +51,10 @@ pub const MAX_MESSAGE_SIZE: usize = 64 * 1024 * 1024; /* 64 MiB */
pub const CONNECTION_BACKOFF_BASE: u64 = 2;
pub const IP_BYTE_BUCKET_RATE: usize = 102400 /* 100 KiB */;
pub const IP_BYTE_BUCKET_SIZE: usize = IP_BYTE_BUCKET_RATE;
pub const INBOUND_TCP_RX_BUFFER_SIZE: u32 = 3 * 1024 * 1024; // 3MB ~6MB/s with 500ms latency
pub const INBOUND_TCP_TX_BUFFER_SIZE: u32 = 512 * 1024; // 1MB use a bigger spoon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a technical term, or just informal wording? use a bigger spoon 😄 Not sure how to respond based on the comment lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informal but descriptive.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

✅ Forge suite compat success on 843b204dce971d98449b82624f4f684c7a18b991 ==> 495e74fa3a8357ec294b7063ae6013e51fe0c361

Compatibility test results for 843b204dce971d98449b82624f4f684c7a18b991 ==> 495e74fa3a8357ec294b7063ae6013e51fe0c361 (PR)
1. Check liveness of validators at old version: 843b204dce971d98449b82624f4f684c7a18b991
compatibility::simple-validator-upgrade::liveness-check : 7872 TPS, 5043 ms latency, 7300 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 495e74fa3a8357ec294b7063ae6013e51fe0c361
compatibility::simple-validator-upgrade::single-validator-upgrade : 4596 TPS, 8645 ms latency, 13600 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 495e74fa3a8357ec294b7063ae6013e51fe0c361
compatibility::simple-validator-upgrade::half-validator-upgrade : 4880 TPS, 8529 ms latency, 10900 ms p99 latency,no expired txns
4. upgrading second batch to new version: 495e74fa3a8357ec294b7063ae6013e51fe0c361
compatibility::simple-validator-upgrade::rest-validator-upgrade : 7186 TPS, 5235 ms latency, 10300 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for 843b204dce971d98449b82624f4f684c7a18b991 ==> 495e74fa3a8357ec294b7063ae6013e51fe0c361 passed
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite land_blocking success on 495e74fa3a8357ec294b7063ae6013e51fe0c361

performance benchmark with full nodes : 6803 TPS, 5850 ms latency, 8700 ms p99 latency,(!) expired 360 out of 2905460 txns
Test Ok

@perryjrandall perryjrandall merged commit 9c8d6c7 into main Oct 11, 2022
@perryjrandall perryjrandall deleted the markuze/tcp_cfg branch October 11, 2022 22:43
@perryjrandall
Copy link
Contributor

perryjrandall commented Oct 11, 2022

I merged this forcibly because the smoke tests were broken in CI, the test passed locally

        PASS [  65.698s] smoke-test aptos_cli::validator::test_join_and_leave_validator
------------
     Summary [  65.699s] 1 tests run: 1 passed (1 slow), 64 skipped
perry@Perrys-MBP aptos-node % LOCAL_SWARM_NODE_RELEASE=1 cargo nextest run --release --profile ci --package smoke-test --test-threads 6 --retries 3 -- aptos_cli::validator::test_join_and_leave_validator

listener.set_nonblocking(true)?;
let listener = TcpListener::try_from(listener)?;
let addr = SocketAddr::new(ipaddr, port);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we change this to not set_nonblocking?

bchocho added a commit that referenced this pull request Oct 12, 2022
)

### Description

This was done within `TcpListener.bind()` before #4649.
bchocho added a commit that referenced this pull request Sep 22, 2023
### Description

Tests show that overriding the socket options for send and recv buffer actually hurts performance (even with default linux kernel settings). Logically, this rolls back #4649 but keeping the configs and code around in case this or other socket options are revisited.

### Test Plan

New results:
* `net_bench_two_region_env`: 800 KB/s -> 4 MB/s
* `pfn_performance_with_realistic_env`: 4K -> 6K TPS
bchocho added a commit that referenced this pull request Nov 2, 2023
Tests show that overriding the socket options for send and recv buffer actually hurts performance (even with default linux kernel settings). Logically, this rolls back #4649 but keeping the configs and code around in case this or other socket options are revisited.

New results:
* `net_bench_two_region_env`: 800 KB/s -> 4 MB/s
* `pfn_performance_with_realistic_env`: 4K -> 6K TPS
bchocho added a commit that referenced this pull request Nov 2, 2023
…0775)

Tests show that overriding the socket options for send and recv buffer actually hurts performance (even with default linux kernel settings). Logically, this rolls back #4649 but keeping the configs and code around in case this or other socket options are revisited.

New results:
* `net_bench_two_region_env`: 800 KB/s -> 4 MB/s
* `pfn_performance_with_realistic_env`: 4K -> 6K TPS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants