-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
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.
Addresses some of #222. |
Before (low https with median 301 Mbit/s) https://observablehq.com/@libp2p-workspace/performance-dashboard after (high https with median 781 Mbit/s) https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=perf-iperf-tcp |
Pending perf GitHub CI Action run: https://github.com/libp2p/test-plans/actions/runs/5726937426/job/15518354294 Edit: Done |
@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' |
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.
Do I understand correctly that this is set for every run, not just for iperf?
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.
Correct. This set on startup on both machines and is thus set for all benchmarks, all implementations and all versions.
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.