feat(proto): expose max_transmit_segments and max_transmit_datagrams in TransportConfig#645
feat(proto): expose max_transmit_segments and max_transmit_datagrams in TransportConfig#645poka-IT wants to merge 1 commit into
Conversation
f0f183c to
ade217c
Compare
|
I like this direction, as it reflects reality better, that these values need to be different depending on actual usage. |
flub
left a comment
There was a problem hiding this comment.
Yeah, I also think this is a good direction. Doesn't mean the other PR shouldn't happen, but let's do it on top of this one.
ade217c to
e0b77c4
Compare
|
Thanks for the thorough review. All five points addressed in 1. Newline between the two fields removed (grouped with 2. Both accessors on
Two small read-only helpers got added to keep the privacy story clean: 3. 4. Defaults extracted as 5. Setter test rewritten using stats-delta: handshake stats are sampled before sending the stream, then again after, and the assertion is Side-effect: the rustdoc on both setters got compacted, and I trimmed the rustdoc on the |
|
This latest commit simply changes the default value based on the benchmark results outlined in PR #636. |
That's fine, we can do this in the same PR. |
5213ee8 to
411e21c
Compare
|
Thanks, all five addressed. |
|
This seems abandoned. Please try and find the right tradeoff of where to store the configs and how to expose it if re-opening. |
I don't understand, everything has been done here since your latest review. |
|
@poka-IT thanks for the contribution. @flub is most likely referring to this comment, which went largely unaddressed. The request was not only to change the code in certain way but to explore alternatives after the realization that both values might not go together, and to start a conversation about why the changes you decide to include in the code from that point, offer the better tradeoffs. I understand the decision of closing this might be disappointing to you, so I'd like to offer the maintainer perspective. Without the proper analysis from the contributor, the review now comes down to designing the solution itself. This change is not currently on the top of the priority queue for us, but it would be a welcome one, provided a solution is properly evaluated and justified. For future endeavors, the last commit also had CI failing with a test that might be transient. As far as I can tell there was no exploration of why that might be. The answer might easily be that it's unrelated but lack of addressing it gave us as well the impression that the PR had been abandoned. Please feel welcome to contribute in the future and remember to keep these notes in mind |
Description
Replace the hardcoded constants
MAX_TRANSMIT_SEGMENTS = 10andMAX_TRANSMIT_DATAGRAMS = 20innoq::Connection::drive_transmitwith two configurable fields onTransportConfig. Defaults are unchanged (10 / 20), so default behavior is preserved.New API:
This is an alternative to #636 (which simply bumps the constants to 40 / 80 globally). After feedback from @flub there, exposing the values as a runtime knob seems more defensible:
transport.max_transmit_segments(NonZeroUsize::new(40).unwrap())and get the throughput / CPU-efficiency gains demonstrated in the perf(connection): raise MAX_TRANSMIT_SEGMENTS to 40 and MAX_TRANSMIT_DATAGRAMS to 80 #636 benches.enable_segmentation_offload,congestion_controller_factory, etc.Why a setter rather than a higher default
MAX_TRANSMIT_SEGMENTS = 10is exactly equal toMIN_BURST_SIZEinnoq-proto/src/connection/pacing.rs:162, the historical 10 was likely chosen to match the pacer's minimum burst. The pacer itself, however, already allows up toMAX_BURST_SIZE = 256per burst, so even a setter value of 256 stays within the existing pacer envelope. CC and pacing remain authoritative; the constants are just an outer cap.Trade-offs now self-documenting
max_transmit_segments * current_mtubytes pre-allocated inTransmitBufperConnection(rustdoc on the setter spells this out).drive_transmitreferencing Congestion window grows without bound when CPU-bound quinn-rs/quinn#1126).Breaking Changes
n/a, defaults preserved (10 / 20).
Notes & open questions
noq-proto/src/tests/mod.rs:default_max_transmit_settings: defaults remain 10 / 20.max_transmit_segments_setter_caps_batch_size: setter at 4 caps the observed GSO batch size.noq-protoandnoqlib tests still pass locally.Defaultvalues.Bench data motivating both PRs (paired same-session, 3x CCX23 Hetzner, real network: intra-DC and inter-region EU) is in the discussion thread of #636.
Change checklist