Learn how to configure TCP BBR congestion control on AlmaLinux 9 server.
When it comes to improving network performance on AlmaLinux, one of the most powerful tools we can use is TCP BBR (Bottleneck Bandwidth and Round-trip propagation time). Unlike traditional congestion control algorithms like Reno or Cubic, TCP BBR focuses on estimating the actual bandwidth and latency of a connection to maximize throughput and reduce latency. It was developed by Google and is now supported in modern Linux kernels.
In this guide, we’ll walk through everything step-by-step—from understanding what BBR does to enabling and verifying it on an AlmaLinux server.
What Is TCP BBR and Why Does It Matter?
Most Linux servers use traditional congestion control methods that rely on packet loss to detect network congestion. These algorithms tend to be overly conservative and slow down data transfers even when the network can handle more traffic.
TCP BBR takes a different approach. It:
- Measures available bandwidth and round-trip time to optimize transmission.
- Avoids waiting for packet loss as a signal.
- Keeps latency low and throughput high—especially in high-bandwidth or long-distance networks.
When enabled, BBR can dramatically improve performance for services like web servers, video streaming, large file downloads, and more.
Prerequisites
Before we begin, let’s ensure we have the following in place:
- A Ubuntu 24.05 dedicated server or KVM VPS.
- A basic programming knowledge.
Understanding and Configuring TCP BBR Congestion Control on AlmaLinux for Faster Traffic
Step 1: Check Kernel Version
BBR is available in Linux kernel 4.9 and above. Let’s verify the kernel version:
uname -r
If it’s 4.9+, we’re good to go. If not, we’ll need to upgrade the kernel.
To upgrade (if needed):
sudo dnf install -y kernel kernel-core kernel-modules
sudo reboot
After reboot, run uname -r
again to confirm the version.
Step 2: Enable BBR Congestion Control
Let’s now configure AlmaLinux to use BBR by modifying the sysctl settings.
Open the sysctl
configuration file:
sudo nano /etc/sysctl.conf
Add or modify the following lines at the bottom:
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
Here’s what these mean:
- fq: Fair Queuing, which works best with BBR.
- bbr: Enables the BBR congestion control algorithm.
Now apply the changes:
sudo sysctl -p
Step 3: Verify That BBR Is Active
To check if BBR is now the active algorithm, run:
sysctl net.ipv4.tcp_congestion_control
Expected output:
net.ipv4.tcp_congestion_control = bbr
Check if BBR is listed as available:
sysctl net.ipv4.tcp_available_congestion_control
And confirm it’s in use:
lsmod | grep bbr
If you see tcp_bbr in the output, BBR is successfully loaded and active.
Step 4: Test Network Performance
We can now test the improvements BBR brings. Tools like iperf3 are ideal for bandwidth benchmarking.
Install iperf3:
sudo dnf install -y iperf3
Run a basic test (with a remote server also running iperf3 in server mode):
iperf3 -c <server_ip>
Compare results with and without BBR to evaluate performance boosts.
Step 5: Make It Persistent and Safe
Our sysctl.conf
changes are already persistent, but let’s double-check:
cat /etc/sysctl.conf | grep bbr
Also, be cautious when enabling BBR on systems with older applications or custom kernels, as they may not fully support BBR.
When Should We Use TCP BBR?
- Hosting video, large files, or high-traffic websites.
- Running long-distance connections (e.g., cross-region APIs or services).
- Wanting better speed for latency-sensitive applications.
Avoid it:
- If we’re using specialized networking stacks that might conflict.
- On kernels older than 4.9 (not supported).
1. Benchmarking Network Speed on AlmaLinux
Before and after enabling BBR, we should measure baseline network performance. Here’s how:
a. Install iperf3
sudo dnf install -y iperf3
b. Run iperf3 as Server on One Node
iperf3 -s
c. Run as Client on Another Node
iperf3 -c <server-ip-address>
This shows throughput in Mbps and allows us to compare before/after enabling BBR.
d. Use nload for Real-Time Traffic Monitoring
sudo dnf install -y nload
nload
It gives real-time traffic stats for each network interface.
2. Automating TCP BBR Setup on AlmaLinux
Option A: Using a Shell Script
We can create a reusable script to enable TCP BBR on any AlmaLinux system:
#!/bin/bash
echo "Checking Kernel Version..."
KERNEL_VERSION=$(uname -r | cut -d. -f1)
if [ "$KERNEL_VERSION" -lt 4 ]; then
echo "Kernel version is below 4.9. BBR not supported."
exit 1
fi
echo "Applying BBR Settings..."
sudo tee -a /etc/sysctl.conf > /dev/null <<EOL
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
EOL
sudo sysctl -p
echo "Verifying TCP BBR is enabled..."
sysctl net.ipv4.tcp_congestion_control
lsmod | grep bbr && echo "BBR loaded successfully!" || echo "BBR module not loaded!"
To run:
chmod +x enable_bbr.sh
./enable_bbr.sh
Option B: Using Ansible Playbook
For teams managing multiple servers, Ansible is perfect for automating this configuration.
Step 1: Create the Playbook enable_bbr.yml
---
- name: Enable TCP BBR on AlmaLinux
hosts: all
become: yes
tasks:
- name: Ensure sysctl config for BBR is present
lineinfile:
path: /etc/sysctl.conf
line: "{{ item }}"
create: yes
loop:
- "net.core.default_qdisc = fq"
- "net.ipv4.tcp_congestion_control = bbr"
- name: Apply sysctl settings
command: sysctl -p
- name: Check if BBR module is loaded
shell: lsmod | grep bbr
register: bbr_status
ignore_errors: true
- name: Show BBR status
debug:
msg: "{{ 'BBR is enabled!' if bbr_status.stdout != '' else 'BBR not loaded.' }}"
Step 2: Run the Playbook
ansible-playbook -i inventory enable_bbr.yml
Make sure inventory contains your target IPs or hostnames.
Final Thoughts
TCP BBR is one of the simplest and most impactful tweaks we can make to our AlmaLinux server. By enabling BBR, we allow our server to take full advantage of modern congestion control mechanisms, resulting in faster, more stable, and more efficient traffic handling.
Let’s make our network stack smarter—not just faster.