PanNote Engineering Docs

Linux Kernel TCP/UDP Buffer & Conntrack Tuning

Last updated: 2026-10-14

Modern Linux kernels ship with conservative socket buffer defaults designed for low-memory virtual machines from a decade ago. On high-bandwidth, elevated-RTT WAN links (120–180 ms BDP), small default receive and transmit windows prematurely cap single-stream and QUIC throughput.

1. Bandwidth-Delay Product Calculations

For a 500 Mbps link at 150 ms round-trip latency, the theoretical Bandwidth-Delay Product is:

BDP = 500,000,000 bits/s * 0.150 s / 8 = 9,375,000 bytes (~9.38 MB)

Setting net.core.rmem_max and net.core.wmem_max to 16–32 MiB while raising wmem_default to 2 MiB prevents UDP burst drops under QUIC pacing.

2. Recommended Production Profile

net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.core.rmem_default = 2097152
net.core.wmem_default = 2097152
net.netfilter.nf_conntrack_max = 65536
net.netfilter.nf_conntrack_tcp_timeout_established = 7200
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 30

3. Verification Diagnostics

Inspect UDP send buffer exhaustion counters via nstat -az UdpSndbufErrors and verify active conntrack occupancy against ceiling limits using sysctl net.netfilter.nf_conntrack_count.