feat(proto): expose max_transmit_segments and max_transmit_datagrams in TransportConfig#645
Open
poka-IT wants to merge 1 commit inton0-computer:mainfrom
Open
feat(proto): expose max_transmit_segments and max_transmit_datagrams in TransportConfig#645poka-IT wants to merge 1 commit inton0-computer:mainfrom
poka-IT wants to merge 1 commit inton0-computer:mainfrom
Conversation
4 tasks
…in TransportConfig
f0f183c to
ade217c
Compare
Contributor
|
I like this direction, as it reflects reality better, that these values need to be different depending on actual usage. |
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.
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