Jack Wallen shows you how to use Google's much improved TCP Congestion Control Algorithm on Linux for significant networking speed gains.
Google developed a TCP Congestion Control Algorithm (CCA) called TCP Bottleneck Bandwidth and RRT (BBR) that overcomes many of the issues found in both Reno and CUBIC (the default CCAs). This new algorithm not only achieves significant bandwidth improvements, but also lower latency. TCP BBR is already employed with google.com servers, and now you can make it happen—so long as your Linux machine is running kernel 4.9 or newer.
Out of the box, Linux uses Reno and CUBIC. You can test this by issuing the command:
The above command should report
net.ipv4.tcp_available_congestion_control = cubic reno
Let's make the change to BBR.
What you'll need
The first thing you need to do is make sure your Linux machine is running a supported kernel. Issue the command uname -r. If your kernel is earlier than 4.9, this won't work. You'll have to upgrade your kernel. For instance, out of the box Ubuntu 16.04 runs kernel 4.4. If your server is such that the kernel can be updated, Ubuntu now has a very easy means of updating to a much newer kernel. To do this, open a terminal window and issue the following two commands:
sudo apt update sudo apt install --install-recommends linux-generic-hwe-16.04
After running the above commands, reboot the server. Once the server is booted, login and issue the uname -r command. You should now see the server running at least kernel 4.13 (as of this writing).
Now that you have a supporting kernel, let's set BBR as the default congestion control algorithm.
Setting BBR as the default is simple. Open up a terminal window and issue the command sudo nano /etc/sysctl.conf. At the bottom of this file, add the following two lines:
Save and close that file. Reload sysctl with the command sudo sysctl -p. Now when you check which congestion control algorithm is in use (with the command sysctl net.ipv4.tcp_congestion_control), you will see output containing bbr (Figure A).
That's all there is to it. You can now enjoy Google's much improved CCA on Linux. You should see significant improvements with network speed on that server.
- How to speed up Apache with Varnish HTTP cache (TechRepublic)
- How to install and use Dockstation for easy container builds (TechRepublic)
- How to install and use the smem memory reporting tool in Linux (TechRepublic)
- How to use syslog-ng to collect logs from remote Linux machines (TechRepublic)
- How to stop and start services in Linux (TechRepublic Video)
- How to use the Linux iostat command to check on your storage subsystem (TechRepublic)
- Learn how to run Linux on Microsoft's Azure cloud (ZDNet)