Tune HTTP/3 client performance - #892
Merged
Merged
Conversation
- Align QUIC flow-control windows with the HTTP/2 client (stream_receive_window / send_window = (1 << 30) - 1); quinn's default 1.25MB stream window caps per-stream throughput over real networks - Enlarge UDP socket buffers to 8MB (as far as the OS allows) to avoid packet loss at high request rates - Drop the endless_emitter channel from work_until: request workers now loop until the deadline semaphore closes, like the HTTP/2 path, removing a channel round-trip per request - Move the HTTP/3 connect path out of Client::client into connect_http3 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Brings the HTTP/3 client's transport configuration in line with the HTTP/1/HTTP/2 implementations and removes per-request overhead from the
work_untilpath.stream_receive_window(1.25MB) caps per-stream throughput at 1.25MB/RTT over real networks. Setstream_receive_window/send_windowto(1 << 30) - 1, matching the window sizes the HTTP/2 client already uses (from nghttp2's default).net.core.rmem_maxis small.endless_emitterchannel fromwork_until: request workers previously consumed a token from a kanal channel per request, fed by a task sendingNonein a loop. Workers now loop until the deadline semaphore closes, matching the HTTP/2 implementation.Client::clientintoconnect_http3.Benchmarks
Loopback (WSL2, 32 cores, local quinn/h3 server): throughput unchanged within noise — ~100k req/s (
-c 50), ~200k req/s (-c 50 -p 10, on par with HTTP/1), 100% success at-c 100 -p 100. The window/buffer changes target real-network conditions (RTT > 0, tunedrmem_max), which loopback cannot exercise.Profiling (pprof) shows the remaining client CPU is dominated by h3's per-request QPACK encoding (~18%) and quinn's connection driver (~30%), so further gains would need upstream changes.
Test plan
cargo test/cargo test --features http3(79 tests pass)cargo clippy --features http3 --all-targetsclean--no-tuiagainst a local HTTP/3 server, including the restructuredwork_untildeadline handling🤖 Generated with Claude Code