Networking
TCP BBR Congestion Control: What It Is and How to Enable It on Linux
By NileVPS Team · Published · 4 min read
اقرأ المقال بالعربيEvery TCP connection has to answer one question continuously: how fast can I send without overwhelming the network? The algorithm that answers it is called congestion control, and on Linux the default is CUBIC. Google's BBR takes a different approach that often delivers better throughput on long-distance or slightly lossy paths, which is exactly the situation when a server in Europe serves users in the Middle East or Asia. This guide explains what BBR does, when it is worth enabling, and how to turn it on and confirm it works on a Linux VPS.
Loss-based vs model-based congestion control
Traditional algorithms such as Reno and CUBIC are loss-based. They keep increasing the sending rate until packets are dropped, treat the loss as a congestion signal, cut the rate, and start growing again. This has two side effects:
- On paths with random loss that has nothing to do with congestion (common on long international routes and wireless links), CUBIC backs off unnecessarily and throughput suffers.
- Before loss happens, buffers in routers fill up, which adds queuing delay. This is sometimes called bufferbloat.
BBR (Bottleneck Bandwidth and Round-trip propagation time) is model-based. It continuously estimates two values: the bottleneck bandwidth of the path and the minimum round-trip time. It then paces packets at roughly the measured bandwidth, keeping about one bandwidth-delay product of data in flight. Isolated packet loss does not make it collapse, and it tries to avoid filling buffers in the first place.
| CUBIC | BBR | |
|---|---|---|
| Congestion signal | Packet loss | Measured bandwidth and RTT |
| Reaction to random loss | Reduces rate sharply | Mostly unaffected |
| Queue build-up | Tends to fill buffers | Tries to keep queues short |
| Default on Linux | Yes | No, must be enabled |
What BBR does and does not change
BBR only affects the sending side of a connection. Enabling it on your VPS improves data the server sends: web pages, file downloads, video streams, API responses. It does not change how fast clients upload to you; that depends on the client's own operating system.
It is also not magic. On a short, clean path with spare capacity, CUBIC and BBR perform about the same. The gains show up on high-latency or lossy routes. The original BBR (v1, the version in mainline Linux) has also been criticized for being unfair to CUBIC flows sharing the same bottleneck, so it is a better fit for servers than for shared office links.
Requirements
- Linux kernel 4.9 or newer. Check with
uname -r. Any current distribution such as Ubuntu 22.04/24.04, Debian 12 or AlmaLinux 9 qualifies. - A full virtual machine (KVM). Containers share the host kernel and usually cannot change these settings.
- Root or sudo access.
Step 1: Check the current state
sysctl net.ipv4.tcp_congestion_control
sysctl net.ipv4.tcp_available_congestion_control
sysctl net.core.default_qdiscA typical fresh system shows cubic as the active algorithm. If bbr is not listed as available, load the module:
sudo modprobe tcp_bbr
lsmod | grep bbrTo load it automatically at boot:
echo tcp_bbr | sudo tee /etc/modules-load.d/bbr.confStep 2: Enable BBR persistently
Create a sysctl drop-in file:
sudo tee /etc/sysctl.d/90-bbr.conf <<'EOF'
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
EOF
sudo sysctl --systemThe fq (Fair Queue) queuing discipline provides packet pacing. Kernels before 4.13 required it for BBR to work correctly; newer kernels can pace inside TCP itself, but fq remains the commonly recommended pairing. Note that default_qdisc applies to interfaces created afterwards, so either reboot or replace the qdisc on your main interface now:
ip route show default # find the interface name, e.g. eth0
sudo tc qdisc replace dev eth0 root fqStep 3: Verify
sysctl net.ipv4.tcp_congestion_control # should print bbr
tc qdisc show dev eth0 # should show fq
ss -ti | grep -o 'bbr' | head -n 3 # live connections using bbrThe congestion control setting applies to new connections, so existing long-lived sessions keep using CUBIC until they reconnect.
Step 4: Measure, do not assume
Measure before and after with a real workload. iperf3 is the simplest tool: run iperf3 -s on your VPS and, from a distant client, iperf3 -c your-server-ip -R -t 30 (the -R flag makes the server send, which is the direction BBR affects). You can also time a large download with curl -o /dev/null -w '%{speed_download}\n' https://your-domain/test.bin. Repeat several times at different hours, because internet paths change. Our article on server latency explains how to measure round-trip times properly.
Rolling back
If you see no benefit or something misbehaves, remove the file and restore the defaults:
sudo rm /etc/sysctl.d/90-bbr.conf
sudo sysctl -w net.ipv4.tcp_congestion_control=cubic
sudo sysctl -w net.core.default_qdisc=fq_codelUse the default qdisc your distribution originally reported in Step 1. Changes are instant and harmless to try, which makes BBR one of the easiest network experiments you can run on a fresh VPS deployment.
FAQ
Is BBR safe to enable on a production server?
Yes, it has been in the mainline kernel since 4.9 and is widely used on servers. Enable it on one machine first, measure, and roll out further only if the numbers improve for your traffic.
Do I need to enable BBR on the client too?
No. BBR on the server improves traffic the server sends. Clients only benefit for uploads if their own operating system uses a similar algorithm.
Is BBR available on Windows Server?
Not in the same form. Windows uses its own congestion control algorithms, configured with PowerShell's Set-NetTCPSetting. The steps in this article apply to Linux only.