Back to site

TCP BBR and network sysctl

Enable BBR congestion control and optimize network sysctl parameters on a HolyCloud Linux VPS to improve throughput and latency.

TCP BBR and network sysctl

BBR (Bottleneck Bandwidth and Round-trip propagation time) is a TCP congestion control algorithm from Google. On a HolyCloud Performance VPS, combined with appropriate sysctl settings, it can improve throughput and reduce latency on high-bandwidth links or moderate loss.

Prerequisites

  • Linux kernel 4.9+ (BBR v1); BBR v2 on recent kernels (optional)
  • root or sudo access
  • Understanding: gains depend on the network path; no miracle on a saturated client-side link
  • Backup network configuration before changes

Check kernel and current algorithm

uname -r
sysctl net.ipv4.tcp_congestion_control
sysctl net.core.default_qdisc
lsmod | grep tcp_bbr

If tcp_bbr is missing:

sudo modprobe tcp_bbr
echo "tcp_bbr" | sudo tee /etc/modules-load.d/bbr.conf

Enable BBR (v1)

File /etc/sysctl.d/99-network-bbr.conf:

# queue and buffers
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

# TCP buffers (adjust for RAM — example 4 GB VPS)
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216

# general optimizations
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_mtu_probing = 1

Apply:

sudo sysctl --system
sysctl net.ipv4.tcp_congestion_control

Expected result: bbr.

Additional sysctl (web server)

# incoming connections
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.ip_local_port_range = 1024 65535

# TIME_WAIT (very connected server)
net.ipv4.tcp_tw_reuse = 1

tcp_tw_reuse is safe for outbound connections; it does not replace keep-alive / pool architecture.

IPv6

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.forwarding = 0

If you do not use IPv6, disabling can simplify things — HolyCloud often provides IPv4+IPv6: test before disabling.

Verify the effect

ss -tin | grep -i bbr | head

Throughput test (from the VPS to an external server):

sudo apt install -y iperf3
iperf3 -c ping.online.net -R

Compare before/after at the same time and on the same network path. ±10% variation is normal.

Latency monitoring

ping -c 20 1.1.1.1
mtr -rwzbc100 8.8.8.8

BBR does not fix poor routing to your audience — a CDN remains relevant for global web traffic.

Rollback

sudo rm /etc/sysctl.d/99-network-bbr.conf
sudo sysctl -w net.ipv4.tcp_congestion_control=cubic
sudo sysctl --system

BBR v2 (recent kernels)

On some distributions:

sysctl net.ipv4.tcp_available_congestion_control
# if bbr2 is present
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr2

Test in staging: different behavior on very lossy links.

Precautions

  • Do not copy “magic sysctl” values from forums without adapting to RAM/workload.
  • LXC/Docker containers often inherit host sysctl — configure the VPS host.
  • HolyCloud firewall + iptables remain priorities over TCP QoS.

Troubleshooting

| Problem | Approach |

|----------|-------|

| BBR not listed | Kernel too old, module not loaded |

| No gain | Application bottleneck, disk, PHP — not the network |

| Strange connections | Switch back to cubic to isolate |

Need help?

Open a ticket with sysctl -a | grep tcp, uname -r, VPS Performance plan type, and a description of the traffic (upload, streaming, API).