Anlan's Notes

Tuning Linux TCP Congestion Control with BBR and FQ

On long-RTT links with modest packet loss, traditional loss-based congestion control algorithms like CUBIC cut their congestion window aggressively whenever a single packet drops. BBR (Bottleneck Bandwidth and Round-trip propagation time) models the pipe instead, keeping throughput steady while avoiding bufferbloat.

Enabling BBR with Fair Queueing

On Ubuntu 24.04 (Linux 6.8+), both fq and tcp_bbr are available out of the box. Pairing BBR with the fq qdisc ensures accurate packet pacing:

cat << 'EOF' > /etc/sysctl.d/99-tcp-bbr.conf
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_slow_start_after_idle = 0
EOF

sysctl --system

Why Disable Slow Start After Idle?

By default, Linux resets the TCP congestion window back to the initial value after a connection sits idle for more than one RTO. For persistent HTTP/2 or RPC connections that send bursty traffic every few seconds, setting net.ipv4.tcp_slow_start_after_idle = 0 avoids repeated ramp-up delays.

Verification

You can inspect per-socket congestion control and pacing rates directly via ss:

ss -tin state established | head -n 20

Look for bbr alongside pacing_rate and bw estimates in the socket output.