feat: add a mach saturate command to saturate a network and determine its capacity#33
Open
fisherdarling wants to merge 8 commits intomainfrom
Open
feat: add a mach saturate command to saturate a network and determine its capacity#33fisherdarling wants to merge 8 commits intomainfrom
mach saturate command to saturate a network and determine its capacity#33fisherdarling wants to merge 8 commits intomainfrom
Conversation
c1a5013 to
94cb271
Compare
94cb271 to
2b375ad
Compare
BenMatase
reviewed
Jan 2, 2026
| /// Saturate the upload (egress) side of the network. | ||
| Up { | ||
| /// The URL to upload data to. | ||
| #[clap(short, long, default_value = "http://speed.cloudflare.com/__up")] |
There was a problem hiding this comment.
I tested this out and was having issues withup reporting a capacity of 0. I was getting it with h1-clear-text (default) and h2:
[root@BenMTestSpeedtest networkquality-rs]# ./target/release/mach saturate --conn-type h2 up
2026-01-02T17:29:06.075011Z INFO mach::saturate: running upload (egress) network saturation test upload_url=http://speed.cloudflare.com/__up
... (channel closed error a bunch of times)
2026-01-02T17:29:25.096166Z ERROR nq_rpm: error: channel closed
{
"download": null,
"upload": {
"capacity": 0,
"dur": 20.001
}
}
I remembered this when I was testing my change before that the upload endpoint didn't seem to like cleartext.
I made a code change to try tweaking this to https:// and now I get good measurements.
[root@BenMTestSpeedtest networkquality-rs]# ./target/release/mach saturate up
2026-01-02T18:20:17.649918Z INFO mach::saturate: running upload (egress) network saturation test upload_url=https://speed.cloudflare.com/__up
{
"download": null,
"upload": {
"capacity": 11931746304,
"dur": 20.001
}
}
Based on a quick pcap, it does seem to follow the url (port 80 with http on download and port 443 with https on upload). Both with default conn-type which should be h1-clear-text.
Do you know why the upload endpoint seems to not like http?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new command
mach saturate <direction>which saturates the network in the given direction.When
bothis requested, the download and upload directions of the network are tested simultaneously.The output is a simple JSON which describes the capacity of the network:
Implementation
The implementation is actually a small modification to the responsiveness (RPM) test. We simply add a flag to the RPM test which disables sending of the first probe. The RPM test will find the network capacity and break after the maximum duration has been reached.
Also, we add support for plaintext HTTP/1.1 connections to the given origin. This should remove any overhead from TLS and means the calculated goodput should be closer to the true bandwidth.
Finally, we modernize the repo a bit and fix a bug around upload body counting.