Skip to content

Instantly share code, notes, and snippets.

@makidoll
Last active November 25, 2023 15:39
Show Gist options
  • Save makidoll/9585c00892a3c23736e11d4d84e2debe to your computer and use it in GitHub Desktop.
Save makidoll/9585c00892a3c23736e11d4d84e2debe to your computer and use it in GitHub Desktop.
Increase server bandwidth with Google's TCP BRR

Increase server bandwidth using Google's TCP BRR

I'd recommend looking at my gist for Linux XanMod instead.
It includes BRR by default and more network optimizations.


Disclaimer: there's BRR2 or something but I haven't looked into it yet

TCP BRR (Bottleneck Bandwidth and RTT) is a congestion control algorithm.

Linux servers will use Reno and CUBIC algorithms by default which suck.

If you're running a homelab where ISP peering is garbage, BRR can really help.

Check what's enabled

# check available
sysctl net.ipv4.tcp_available_congestion_control
# check current
sysctl net.ipv4.tcp_congestion_control

If it prints cubic reno then you better go enable brr right now.

How to enable

Make sure you're using kernel 4.9 or higher. Check with uname -r

sudo nano /etc/sysctl.conf

And add to the very bottom:

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_window_scaling = 1

Apply using sudo sysctl -p

Check using the above commands if it's enabled.

Make sure to restart Docker too using sudo systemctl restart docker

Optionally docker exec into a container and run the same commands to check.

Original article

https://www.linuxbabe.com/ubuntu/enable-google-tcp-bbr-ubuntu

You can find lots of tests and data online if you look for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment