Skip to content

Bound gVisor TCP send buffers for TUN forwarding - #154

Merged
andre487 merged 1 commit into
mainfrom
perf/tcp-send-buffer
Nov 21, 2026
Merged

andre487 merged 1 commit into
mainfrom
perf/tcp-send-buffer

Conversation

@andre487

@andre487 andre487 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Large TCP send queues make gVisor RACK scan many outstanding segments when processing TUN ACKs. Set the initial send buffer to 32 KiB and cap growth at 128 KiB in both ordinary and strict source-validation modes. Keep RACK enabled and the existing receive-buffer policy unchanged.

A regression test creates the actual stack in both modes and verifies the limits and recovery settings. EN/RU documentation explains the policy and its tradeoff: the cap can constrain high-bandwidth paths with large RTT.

Validation for head df8ceb81d8bc78b43964f66224b3a76ffb68af26:

  • CI passed native Go tests, Android JVM checks and device scenarios on API 26 and API 35.
  • Local Android API 35/KVM benchmarks completed 108/108 HTTP/1.1, SOCKS5 and direct TCP measurements successfully.
  • A separate HTTP/3 series with a fresh VPN session per measurement passed 48/48 cases. Persistent-session HTTP/3 failures remain unresolved and are not fixed by this PR.

Benchmark reports, temporary harnesses and generated artifacts are not committed. Emulator throughput does not establish performance on physical ARM devices or WAN paths.

@andre487
andre487 merged commit e516967 into main Nov 21, 2026
15 checks passed
@andre487
andre487 deleted the perf/tcp-send-buffer branch November 21, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant