BBR, short for Bottleneck Bandwidth and Round-Trip Time, is an advanced congestion control algorithm developed by Google and integrated into the Linux kernel's TCP stack. Implementing BBR can result in notably enhanced throughput and lower latency for network connections on a Linux server. A major advantage of BBR is its simplicity in deployment—it only requires changes on the sender's end, with no adjustments needed on the network infrastructure or the receiver's system.
Requirements
- A CentOS 7 x64 virtual server
- User access with sudo privileges
Matching infrastructure at centron
No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →
Step 1: Kernel Upgrade via ELRepo Repository
To activate BBR, the Linux kernel on your CentOS 7 machine must be upgraded to version 4.9.0. This can be done smoothly using the ELRepo RPM repository.
Check the Current Kernel Version
Before proceeding with the upgrade, verify your current kernel version:
uname -rThis should return a string similar to:
3.10.0-514.2.2.el7.x86_64This indicates that your current kernel is version 3.10.0.
Enable the ELRepo Repository
Install the ELRepo GPG key and repository package:
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpmInstall the Latest Kernel
Now, use the ELRepo source to install the mainline kernel version 4.9.0:
sudo yum --enablerepo=elrepo-kernel install kernel-ml -yVerify Installed Kernels
Ensure that the kernel has been successfully installed:
rpm -qa | grep kernelAmong the results, you should see entries like:
kernel-ml-4.9.0-1.el7.elrepo.x86_64
kernel-3.10.0-514.el7.x86_64
kernel-tools-libs-3.10.0-514.2.2.el7.x86_64
kernel-tools-3.10.0-514.2.2.el7.x86_64
kernel-3.10.0-514.2.2.el7.x86_64Set Default Kernel to 4.9.0
Configure GRUB2 to boot with the new kernel by default. First, list the available menu entries:
sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'The output may include entries such as:
CentOS Linux 7 Rescue a0cbf86a6ef1416a8812657bb4f2b860 (4.9.0-1.el7.elrepo.x86_64)
CentOS Linux (4.9.0-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-bf94f46c6bd04792a6a42c91bae645f7) 7 (Core)Since the 4.9.0 entry is at position 1, configure it as default:
sudo grub2-set-default 1Restart and Confirm
Restart your system to apply the changes:
sudo shutdown -r nowAfter the server reboots, reconnect and check the current kernel version again:
uname -rYou should now see:
4.9.0-1.el7.elrepo.x86_64Step 2: Activating the BBR Congestion Control Mechanism
To switch on the BBR algorithm, you'll need to adjust the system's sysctl configuration settings as shown below:
echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
sudo sysctl -pAfter making these changes, you can verify that BBR has been properly enabled using the following commands:
sudo sysctl net.ipv4.tcp_available_congestion_controlThis command should output something like:
net.ipv4.tcp_available_congestion_control = bbr cubic renoNext, check which congestion control algorithm is currently active:
sudo sysctl -n net.ipv4.tcp_congestion_controlThe expected output is:
bbrTo ensure the BBR kernel module is actively loaded, run this:
lsmod | grep bbrThe terminal should return something similar to:
tcp_bbr 16384 0Step 3 (Optional): Verifying Network Speed Improvements with BBR
To determine the performance improvements achieved by BBR, you can conduct a file download test through a web browser from your desktop. Begin by installing and starting Apache HTTP Server:
sudo yum install httpd -y
sudo systemctl start httpd.serviceNext, adjust your firewall settings to permit HTTP traffic:
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reloadNow create a dummy file for download testing:
cd /var/www/html
sudo dd if=/dev/zero of=500mb.zip bs=1024k count=500Finally, open a browser on your local machine and navigate to:
http://[your-server-IP]/500mb.zip
This will allow you to download the test file and observe the download speed for performance assessment.
Conclusion
By following the steps above, you've successfully enabled BBR on your CentOS 7 server. This modern congestion control algorithm can significantly boost your server's network throughput and minimize latency, especially under heavy traffic conditions. The process involves updating your kernel, modifying system configurations, and optionally testing performance improvements through a simple HTTP download.
Since BBR only requires changes on the sender side, it's ideal for server administrators looking to optimize data transmission without making changes to clients or network infrastructure. With BBR now active, your server is better equipped to handle demanding network conditions with improved efficiency.
Testen Sie Ihr Setup auf ccloud³
Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.