Linux UDP receive sysctl reference
Tune every Linux network sysctl on the normal high-rate IPv4 UDP receive path with defaults, receiver values, and parameter-specific failure modes.
Baseline assumptions
The recommended column targets a dedicated receiver for the measured 54.3 Mbps and 5,585 packets-per-second feed. It is a starting configuration for testing, not a claim that one number fits every kernel, NIC, driver, namespace, and workload.
Linux defaults below are upstream defaults where one fixed value exists. A distribution, kernel configuration, boot-time memory calculation, container runtime, or loaded module can change the active value. Read every deployed value before applying a change.
Socket memory
Set net.core.rmem_max before the process creates the socket. The process should request its own SO_RCVBUF and read back the effective value. Linux commonly reports twice the requested value for socket bookkeeping, so a 4,194,304-byte request can appear as 8,388,608 bytes.
Input backlog and NAPI budgets
Check the second and third fields of each row in /proc/net/softnet_stat as deltas. A backlog setting cannot repair NIC-ring drops, and a socket-buffer setting cannot repair an earlier softnet drop.
Busy polling
Busy-poll support depends on kernel, driver, NAPI association, privileges, and socket options. SO_BUSY_POLL_BUDGET and the epoll busy_poll_budget field are not sysctls and therefore are outside the table. A configured value with no compatible NAPI path can consume configuration effort while changing nothing. Measure p50, p99.9, CPU, softnet counters, socket drops, and decode age together.
Steering and timestamp placement
RPS and RFS also require per-queue sysfs masks and flow counts, which are outside sysctl. On a NIC with enough hardware queues, one critical UDP tuple normally benefits from stable flow affinity more than from being moved between CPUs in software.
IPv4 demultiplexing and fragments
Do not raise fragment thresholds to conceal an MTU failure. With an ordinary 1,500-byte path MTU, the documented maximum UDP payload fits without IP fragmentation under the usual IPv4 and UDP headers.
Reverse-path filtering
Mode 0 disables reverse-path checks, mode 1 is strict, and mode 2 is loose. Test the actual route to 64.130.40.90 and the interface that receives the feed before selecting a mode.
Conntrack, when loaded
Conntrack sysctls exist only when the subsystem is loaded and visible in the namespace. One stable feed tuple consumes about one entry, while packet rate determines lookup work. On a receiver that performs no NAT and has a narrow stateless firewall rule, an early notrack rule can remove the feed from conntrack rather than tuning a global table around one flow.
Apply changes as experiments
Change one layer at a time. Reboot or recreate the namespace when testing persistence. Record kernel release, active values, NIC and driver, queue mapping, receiver build, packet distribution, loss counters, CPU, and latency before and after.
Questions
- Which receive-buffer values should a shred receiver start with?
- On dedicated Linux hosts, keep the active net.core.rmem_default, raise net.core.rmem_max to 134,217,728 bytes, and have the application request SO_RCVBUF of 4,194,304 bytes. Read back the effective value, then validate it with controlled pauses, UdpRcvbufErrors, per-socket drops, queue residence, and catch-up time.
- Should busy polling be enabled globally?
- Keep net.core.busy_read and net.core.busy_poll at zero by default. On a dedicated receiver, test SO_BUSY_POLL of 50 microseconds on the target socket. A useful result lowers tail latency without socket loss or a saturated ingest core. Global settings affect unrelated sockets and can waste CPU continuously.
- Can sysctl tuning eliminate UDP loss?
- No. Sysctls can move or resize specific kernel queues, but they cannot repair NIC loss, an undersized driver ring, bad affinity, sustained application under-capacity, a restrictive firewall, or upstream absence. Locate the first rising drop counter, change the control for that stage, and verify packet age as well as loss.