BBR, Proxmox containers, and Starlink
I tried to sync a bunch of big data last night and only got 5MBytes/s despite 30MBytes/s being expected. The fix turned out to be enabling BBR congestion control on the Proxmox host and container I was syncing from.
In detail... I first learned about BBR congestion control three years ago. It’s an alternative TCP congestion control algorithm you enable on a server. It greatly improves performance for Starlink clients connecting to that server. Enabling BBR instantly boosted rsync performance from 5MB/s to 30MB/s for me: that is expected. It’s so extreme because of the high packet loss of Starlink. It’s probably the same for clients on cellular links.
To enable BBR in a container, the easiest way is just to enable BBR in the Proxmox host and then restart the container. On Proxmox:
# Load and enable BBR right now without reboot
modprobe tcp_bbr
sysctl -w net.ipv4.tcp_congestion_control=bbr
# Enable BBR on reboot
echo tcp_bbr >| /etc/modules-load.d/bbr.conf
echo 'net.ipv4.tcp_congestion_control = bbr' >| /etc/sysctl.d/90-bbr.conf
It is not necessary to explicitly enable BBR in containers. They will pick up the Proxmox host’s congestion control algorithm on restart. However any existing containers won’t switch immediately. You can run this in the container to switch without restarting:
sysctl -w net.ipv4.tcp_congestion_control=bbr
It is probably necessary to enable BBR in any VMs you have. I haven’t tested this but it must be this way since the VM has its own kernel and TCP/IP stack.
It is possible to have containers have different algorithms than the Proxmox server or each other. I didn’t test this but Claude Code was telling me I needed to load the modules in the Proxmox server and then set net.ipv4.tcp_allowed_congestion_control= reno cubic bbr. After than containers can choose their own algorithm.
(Claude Code was a big help in diagnosing and fixing this problem. I understand all the commands above and tested them myself.)
I continue to wonder why BBR isn’t the default on Linux. Apparently it can cause contention problems if every server isn’t using BBR. Also so much server traffic these days is QUIC and it has its own congestion control. The TCP setting doesn’t matter to a lot of servers.