Calculate network interface queue length needed to avoid packet drops under burst load.
The txqueuelen parameter sets how many packets the kernel can buffer for a network interface before the queueing discipline (qdisc) starts dropping new arrivals, and correctly sizing it means balancing two failure modes: too small drops packets during legitimate bursts or high-latency paths, while too large introduces bufferbloat — packets sit queued for so long that added latency hurts interactive and real-time traffic even though nothing is technically dropped. A reasonable target ties queue depth to the bandwidth-delay product divided by average packet size, giving just enough buffer to absorb one RTT's worth of in-flight data.
Optimal queue depth
optimal_queue_packets = BDP / avg_packet_size
`ip link show <iface>` displays the current qlen value; change it with `ip link set <iface> txqueuelen <N>` (temporary, resets on reboot unless persisted via a network manager profile or udev rule).
Bufferbloat is excessive queuing delay caused by oversized buffers that let packets sit queued far longer than necessary before being dropped or transmitted, defeating TCP's congestion control feedback loop — modern fixes like fq_codel and CAKE actively manage queue depth and latency rather than relying purely on a large static txqueuelen.
Not necessarily on its own — queue sizing should scale with bandwidth-delay product (which factors in RTT, not just bandwidth), so a high-bandwidth but low-latency LAN link may need a smaller queue than a lower-bandwidth but high-latency WAN link.