You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: Tune UDP socket buffers and make chunk size configurable to improve throughput #29
The README documents 15 MB/s on WiFi but only 8.35 MB/s when sending from macOS, and that limitation is still open. Two likely contributors in the current code:
No socket buffer tuning anywhere — neither side calls SetReadBuffer/SetWriteBuffer. At high packet rates the kernel receive buffer overflows and drops datagrams, and the transfer degrades into the missing/resend loop. (Note: commit cb262e1 "Increase the udp buffer on darwin" actually only changed the chunk size — no buffer tuning ever landed.)
Chunk size is hardcoded per OS (pkg/header.go:94: 9000 on darwin, 60000 elsewhere) with no CLI flag:
a 60000-byte datagram fragments into ~40 IP fragments; on lossy WiFi losing one fragment loses the whole datagram, amplifying loss,
the value can't be tuned per network without rebuilding.
Suggested fix
call SetReadBuffer/SetWriteBuffer with sensible sizes on both ends (and document the relevant sysctl limits on Linux),
expose --chunk on transfer send (guarded to ≤ 65357 = 65507 − 150 header bytes); the receiver already learns it from the header,
Activity