Shurn the Awesomer
Speed up your website with TCP BBR

Speed up your website with TCP BBR

Written on Wed, 30 August 2017

Google has come up with a new way of handling network congestion, by pretending there is no congestion. OK, maybe exaggerated, but who can blame me when they outrightly state that "1980s-era algorithm assumes that packet loss means network congestion".

BBR stands for Bottleneck Bandwidth and Round-trip propagation time. According to Google, YouTube network throughput improved by 4 percent on average globally. Wordpress also experience massive improvements of up to 2700 times better than the previous best loss-based congestion control.

Sounds impressive? Why not let's give it a try.

Warning


Back up your server before proceeding. You're likely going to need to change Linux Kernal and other system level changes.

Updating Linux Kernel


Check the Linux Kernel Version

uname -mrs


If it's any version less than 4.9, you need to upgrade it. Otherwise, you can skip ahead to the next section.

Search for the latest linux kernal in the repository.

apt search linux-generic

At the time of writing, the latest version is linux-image-4.11.0-14-generic. TCP BBR is only introduced in 4.9 and higher, so choose any version 4.9 or higher and install.

apt install linux-image-4.11.0-14-generic

You need to reboot the server after this.

reboot

Enable TCP BBR


Enable it at sysctl.conf

nano /etc/sysctl.conf

Append the following lines

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

Apply the settings

sysctl --system

Verify the new settings

sysctl net.core.default_qdisc
sysctl net.ipv4.tcp_congestion_control


You should see the output as what you typed in the sysctl.conf

Test it


Does it work? Maybe. When I did a speed test before and after implementing TCP BBR, there was hardly any noticable improvement in speedtest.