Hetzner Networking

A week and a half ago, I switched hosting my site on Hetzner over to Digital Ocean because things were really slow with Hetzner networking. I was trying to rsync some files from my Hetzner instance to a box on my home network and the transfer rate was in the kilobits per second.

I wanted to see if the problem was really Hetzner because everyone speaks so highly of them. Plus, the price of their services is really great – especially when compared to Digital Ocean.

After poking around for a while, I discovered a configuration change that increased transfer speeds on my Hetzner VPS. The change turned on the use of TCP BBR congestion control.

Turn on TCP BBR Congestion Control

To turn this on, first make sure your Linux kernel (4.9 or higher) supports it:

grep -E 'CONFIG_TCP_CONG_BBR|CONFIG_NET_SCH_FQ' /boot/config-$(uname -r)

You should get this if your kernel has support:

CONFIG_TCP_CONG_BBR=m
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_SCH_FQ=m
CONFIG_NET_SCH_FQ_PIE=m

To turn on TCP BBR congestion control, create a file in /etc/sysctl.d/ Name it whatever you’d like, but it has to end in .conf, so /etc/sysctl.d/22tcpbbr.conf would work. Inside the file add:

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

Save and reload system settings with:

sysctl --system

Or rebooted if you like.

Test Results

I ran tests out of Hetzner’s Hillsboro, OR datacenter using a CPX21 instance (3 vCPU, 4GB RAM) and connecting to it from a server on my home network (symmetric 1Gbps fiber).

Before Change

iperf3 -c x.x.x.x -i 2 -t 10 -R
Connecting to host x.x.x.x, port 5201
Reverse mode, remote host x.x.x.x is sending
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.03 sec 6.18 MBytes 5.17 Mbits/sec 98 sender
[ 5] 0.00-10.00 sec 6.00 MBytes 5.03 Mbits/sec receiver

After Change

iperf3 -c x.x.x.x -i 2 -t 10 -R
Connecting to host x.x.x.x, port 5201
Reverse mode, remote host x.x.x.x is sending
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.03 sec 632 MBytes 528 Mbits/sec 1702 sender
[ 5] 0.00-10.00 sec 629 MBytes 527 Mbits/sec receiver

A really nice bump in performance!

I’ve already moved my Fediverse instance, Mookie’s Place back to Hetzner from Digital Ocean. At Hetzner, I am getting 3x vCPU, 4x RAM, 3x storage and 20x transfer for $2/mo more than what I was paying at Digital Ocean.