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

fix(perf): run iperf on TCP and set TCP windows to bdp #241

Merged
merged 8 commits into from
Aug 4, 2023

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Jul 25, 2023

This commit makes iperf use TCP instead of UDP. Using UDP allows the sender to send as much data as they can, not as much data as the receiver can handle. Using TCP measures the actual bandwidth of the connection.

This commit sets the TCP send and receive window to the bandwidth-delay-product. In order to exhaust the whole bandwidth between the two nodes, TCP needs to be able to buffer all bytes on the wire in the case of packet loss.

This commit makes iperf use TCP instead of UDP. Using UDP allows the sender to
send as much data as they can, not as much data as the receiver can handle.
Using TCP measures the actual bandwidth of the connection.

This commit sets the TCP send and receive window to the bandwidth-delay-product.
In order to exhaust the whole bandwidth between the two nodes, TCP needs to be
able to buffer all bytes on the wire in the case of packet loss.
@mxinden mxinden changed the title fix(perf): run iperf on TCP and set TCP send/receive window to bdp fix(perf): run iperf on TCP and set TCP windows to bdp Jul 25, 2023
@mxinden
Copy link
Member Author

mxinden commented Jul 25, 2023

Addresses some of #222.

@mxinden
Copy link
Member Author

mxinden commented Jul 25, 2023

Before (low https with median 301 Mbit/s)

newplot(3)

https://observablehq.com/@libp2p-workspace/performance-dashboard

after (high https with median 781 Mbit/s)

newplot(2)

https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=perf-iperf-tcp

@mxinden mxinden mentioned this pull request Aug 1, 2023
26 tasks
@mxinden mxinden marked this pull request as ready for review August 1, 2023 12:41
@mxinden
Copy link
Member Author

mxinden commented Aug 1, 2023

Pending perf GitHub CI Action run: https://github.com/libp2p/test-plans/actions/runs/5726937426/job/15518354294

Edit: Done

@mxinden
Copy link
Member Author

mxinden commented Aug 1, 2023

@MarcoPolo @marten-seemann can one of you give this a review?

# machines, the bandwidth-delay-product is ~178.81 MiB. Set send and receive
# window to 200 MiB.
sudo sysctl -w net.ipv4.tcp_rmem='4096 131072 200000000'
sudo sysctl -w net.ipv4.tcp_wmem='4096 20480 200000000'
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correctly that this is set for every run, not just for iperf?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct. This set on startup on both machines and is thus set for all benchmarks, all implementations and all versions.

@mxinden mxinden merged commit cfd1049 into master Aug 4, 2023
@mxinden mxinden deleted the perf-iperf-tcp branch August 4, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants