Add a high-latency server preset - #5
Merged
Merged
Conversation
Neither existing preset addresses round trip time. "speed" shortens the retransmit timeout to 0.5s and "survival" leaves it at the 0.6s default while concentrating on FEC, so on a mobile carrier with a 400ms base RTT and 100ms of jitter the server resends packets whose ACKs are still in flight. The duplicates add the delay that expires the next timer, and a 1000 packet window cannot keep such a path full in the first place. The values come from a deployed Hamrahe Avval server that was hand tuned against exactly this before a preset existed: a 1.0s initial and 4.0s maximum RTO, NACK delays that wait for the reordering window, a 4096 packet window, 32 packet batches, and ingress sized for the requests a long path keeps in flight. SESSION_TIMEOUT_SECONDS is deliberately not raised, because holding abandoned sessions in a fixed size table is what makes a reconnecting client meet SESSION_BUSY and reconnect again. The preset is server-only; applyServerConfigPreset now validates against the server set, which it already had but did not use. Co-Authored-By: Claude Opus 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.
What changed
high-latencypreset, withhigh_latency,highlatency,latency, andmobileaccepted as aliasesapplyServerConfigPresetnow validates against the server preset set, which already existed but was unused — it was checking the client listserver_config.high-latency.tomlalongside the other preset filesWhy
Neither existing preset addresses round trip time.
speedshortens the retransmit timeout to 0.5s, andsurvivalleaves it at the 0.6s default while concentrating on FEC. On a mobile carrier with a 400ms base RTT and 100ms of jitter, both resend packets whose ACKs are still in flight; the duplicates add the delay that expires the next timer, and the tunnel degrades toward a standstill while reporting no loss at all. A 1000 packet window also cannot keep such a path full.An operator running against Hamrahe Avval had already hand tuned a server for this, with
# RTO tuned for 400ms base RTT + 100ms jitterand# NACK delays tuned for high latency (was 0.05s / 0.2s — WAY too aggressive)in their config. This preset is those findings, so the next operator does not have to rediscover them.Values
ARQ_INITIAL_RTO_SECONDSARQ_MAX_RTO_SECONDSARQ_DATA_NACK_INITIAL_DELAY_SECONDSARQ_DATA_NACK_REPEAT_SECONDSARQ_DATA_NACK_MAX_GAPARQ_WINDOW_SIZEMAX_PACKETS_PER_BATCHMAX_DNS_RESPONSE_BYTESUDP_READERS/DNS_REQUEST_WORKERSMAX_CONCURRENT_REQUESTSMAX_INGRESS_QUEUE_BYTESSOCKET_BUFFER_SIZEDEFERRED_SESSION_WORKERS/_QUEUE_LIMITSESSION_TIMEOUT_SECONDSis deliberately not raised, even though the deployed config sets it to 1200. Holding abandoned sessions four times longer in a fixed size table is what makes a client that reconnects mid stall meetSESSION_BUSYand reconnect again.Validation
go build ./...,go vet ./..., andgo test ./...pass🤖 Generated with Claude Code