Investigate http3 support #1033
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1033
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
Since a few minutes cache.nixos.org supports http3, but lix does not.
Describe the solution you'd like
Investigate enabling http3 support in curl and see how well it works.
Describe alternatives you've considered
None, this is purely informational.
Additional context
It does not currently advertise support via Alt-Svc, which may hamper support.
Nothing we can do about that until we have widespread HTTPS resource record support.
If HTTP/3 is something we want to support, this can be split into two questions.
How to enable HTTP/3?
Curl has three relevant knobs here.
CURL_HTTP_VERSION_3, it will try to open QUIC and TLS connections simultaneously, and use HTTP/3 if it works (otherwise it will fall back to the TLS connection and use whichever of 1.2 and 2 comes out of ALPN).Given that HTTPS resource record is experimental in curl, and neither Alt-Svc nor HTTPS record can be observed on cache.nixos.org, the first option seems the best.
When to enable HTTP/3
The three basic options here are never, together with HTTP/2, or as a separate level of support. Given some information from curl it is plausible that "never" may be the best option (as I expect bulk transfer speed and CPU usage to be more relevant than handshake latency in the Lix use case), but without an experiment there is no way to really know. Separate level of support, but enabled by default early in the 2.95 cycle, looks most reasonable to me here. This only applies to builds against nixpkgs ≥25.11, on ≤25.05 I would leave it disabled due to quictls usage in the
curlHTTP3package.considering how stable http 2 is in curl we should probably hold off on turning http 3 on for a very long time of interested parties testing it in their own time. we tried testing h3 with plain curl and it does not work for shit.
I did some measurements with a build of lightly patched Lix main against nixos-unstable (I do not expect the patches to be relevant here, except for the HTTP/3 enablement of course). Machine 1 is running at home, machine 2 in a data center. "Shit internet" has added 5% packet loss and 200 ms delay via tc. "Query" is
nix-build --dry-runof my main system configuration with 20 runs, "substitute" isnix-buildofnixosTests.allDrivers.plasma6from nixos-unstable with 10 runs. All tests were run on a fresh store and emptyXDG_CACHE_DIRboth on tmpfs, except that the drv files were copied in to runnix-builddirectly against them (to avoid including the evaluation in the measurements, which would only add noise).Not visible from the table is the fact that the HTTP/2 and HTTP/3 substitute tests had to be retried once each, as the first attempt failed with an error. Unfortunately hyperfine ate the error message, so that I can't say for sure where the fault lies.
I would summarize the results as follows:
However in total, also taking into account the HTTP/2 bugs encountered earlier (and I have no reason to assume HTTP/3 is going to be better on that front), the case for HTTP/2 or HTTP/3 in Lix does not look that great. Maybe we should actually disable HTTP/2 instead of further adding HTTP/3.
Did you test with https://github.com/NixOS/nixpkgs/pull/458142 applied or not? It is in master but no idea if it has reached one of the channel.
I did some benchmarks on throughput and H2 was able to saturate properly gigabit pipes (once the bug is fixed, of course.), I think it makes sense to keep H2 as long as we can have it reasonably work.
You tested substitution using a xz-enabled cache, what about a zstd-enabled cache? xz destroys performance unnecessarily IME.
That is in nixos-unstable so it was applied (also, otherwise I would expect the HTTP/2 substitute test to fail a lot more often). I did not try with a zstd-enabled cache. In general, I would be surprised if HTTP/2 was actually meaningfully slower in any scenario, but also if it was meaningfully faster during bulk transfers (merely that it is too buggy). Do you have any data that suggests the contrary?
Right away, I don't have any proper data (neither time to jump on this), I will try to look at this again next week, thanks for the info!
HTTP/3 was merged which is the original issue, @alois31 should we move the discussion on "what should be enabled by default" in a new issue?