How to Improve your server by enabling BBR on Ubuntu 22.04

The speed of response on a server is a task that is always subject to have an importance within the responsibilities of a sysadmin. To help with response times, I will show you how to enable BBR on Ubuntu 22.04. I will also explain what it is and what advantage it brings.

Introduction to BBR

BBR is a modern TCP congestion control algorithm. It originated from Google, who tested it in their data centers. This not-so-new algorithm overcomes many of the problems encountered in both Reno and CUBIC (the default CCAs).

As you can imagine, TCP BBR is already in use with Google servers and many other companies worldwide. You can do it, too, as long as your Linux machine is running the kernel 4.9 or newer.

Advantages of enabling BBR on Ubuntu 22.04

The advantages that BBR provides are basically these

  • Significant bandwidth improvements by the system.
  • Decreases latency generated on connections.
  • It evaluates the network and the speed at which it can transmit data by monitoring the network speed.

These advantages simply translate into a faster server and better response times to requests. Therefore, if you have a VPS or you are starting as a sysadmin, it is interesting to learn how to do it.

Requirements to enable BBR on Ubuntu 22.04

To enable BBR on Ubuntu 22.04 you need the following

  • Linux kernel version must be greater than 4.19. Distributions like Ubuntu 22.04 include an even more recent version, so you won’t have any problems.
  • Have the CONFIG_TCP_CONG_BBR and CONFIG_NET_SCH_FQ options compiled and added to the kernel.

Although Ubuntu 22.04 meets these requirements, it is not a bad thing to learn how to check if your system meets all of them.

Check if the system meets the requirements

First, open a terminal using the main menu or start an SSH session.

Then, update the whole system.

sudo apt update
sudo apt upgrade

Then check the installed kernel version

uname -r

Sample Output

5.15.0-47-generic

The kernel version is correct.

Now to check if the CONFIG_TCP_CONG_BBR and CONFIG_NET_SCH_FQ options are compiled and added to the kernel, run this command

sudo cat /boot/config-$(uname -r) | grep 'CONFIG_TCP_CONG_BBR'

And you should have an output like this:

CONFIG_TCP_CONG_BBR=m

For the other option, run:

sudo cat /boot/config-$(uname -r) | grep 'CONFIG_NET_SCH_FQ'

You should have an output screen like this

CONFIG_NET_SCH_FQ_CODEL=m
CONFIG_NET_SCH_FQ=m
CONFIG_NET_SCH_FQ_PIE=m

As you can see, the system meets the requirements to enable BBR.

Enable BBR on Ubuntu 22.04

First, check if BBR is enabled on the system. To do this, run.

sysctl net.ipv4.tcp_available_congestion_control

And you will get an output screen like this:

net.ipv4.tcp_available_congestion_control = reno cubic

Another check can be done with this command:

sysctl net.ipv4.tcp_congestion_control

Sample Output:

net.ipv4.tcp_congestion_control = cubic

And to enable BBR, edit the /etc/sysctl.conf file

sudo nano /etc/sysctl.conf

At the end of the file, add the following lines:

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

Save the changes and close the editor,

Now restart the server to apply the changes.

Conclusion

BBR helps to improve the connection speed of an Ubuntu 22.04 server. This tool, which originates from Google, works really well, and it is not surprising that it has become an ideal option for many sysadmins.

I hope you liked this post, and you can share it with all your friends.

Share This:

Leave a Comment

Your email address will not be published. Required fields are marked *