Repository navigation
Warn when the kernel caps the UDP buffers - #379
Merged
Merged
Conversation
irsync asks for 7 MiB UDP buffers, but a stock Linux kernel quietly gives 208 KB, which made a long-link push three times slower (#375).
The link that showed the problem carries only about 20 MB/s, but over a 143 ms round trip. Word the warning and the book section for that.
iroh asks for 7 MiB per UDP socket, but Linux quietly caps it at net.core.rmem_max. A socket of our own shows what the real ones get (#375).
So the client can warn about a server whose kernel caps them. Protocol version 11.
It probes when it binds its sockets, logs the warning, and sends the result in every HelloAck.
The client probes its own sockets once per run and reads the daemon's result from HelloAck; the reporter prints each machine's warning once, none with -q.
irsync pair leaves a running daemon of the same version alone, so it did not pick up a raised limit. A restart or SIGHUP binds new sockets.
This was referenced Nov 29, 2026
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.
irsync asks for a 7 MiB UDP buffer on each socket (iroh's netwatch does), but a stock Linux kernel quietly gives 208 KiB (
net.core.rmem_max/wmem_max). On a link with a long round trip the receiver then drops packets. Between San Jose and Europe (143 ms) a 2.5 GB push took 9m47s with the default limit and 3m12s with it raised. Nothing told the user.Now irsync says so, on the machine the user types on, for both machines:
net/udp_buffers.rs): opens a UDP socket, asks for 7 MiB each way and reads back what the kernel granted (halved on Linux, which reports double). None on Windows.HelloAck.socket_buffers. Protocol version 11.-q.test-hooksreadIRSYNC_TEST_UDP_BUFFERSinstead of probing, and the test helper sets it to "uncapped", so machines with the small default don't see the warning in other tests.Checked with
tools/ci.sh checkandtools/ci.sh typecheck, and on the real link: both warnings with the limits at 208 KiB, none at 16 MiB after a daemon restart.Design:
docs/superpowers/specs/2026-11-29-udp-buffer-warning-design.md; plan:docs/superpowers/plans/2026-11-29-udp-buffer-warning.md.Still open: the daemon still dropped about 11,000 packets with 7 MiB buffers. Its receive path is probably the next limit, and that's a separate question.
Closes #375