feat: add a mach saturate command to saturate a network and determine its capacity#33
feat: add a mach saturate command to saturate a network and determine its capacity#33fisherdarling wants to merge 9 commits intomainfrom
mach saturate command to saturate a network and determine its capacity#33Conversation
94cb271 to
2b375ad
Compare
cli/src/args/saturate.rs
Outdated
| /// 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?
There was a problem hiding this comment.
Hey! I switched this over to use https://h3.speed.cloudflare.com/__up, I think that might help fix things? I'm guessing the TLS/cleartext settings on our end aren't applied to speed. and only h3.speed..
1de35e9 to
aa10d4c
Compare
Also: - upgrade to boring 5 - change urls from `speed.cloudflare` to `h3.speed.cloudflare` - upload command properly adds Headers - parse fixup responsiveness config parsing
aa10d4c to
8b0ae3b
Compare
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.