The default Linux kernel configuration limits throughput significantly on relays with many concurrent connections. Apply these settings to /etc/sysctl.d/99-tor-relay.conf:
net.core.somaxconn = 65535 net.core.netdev_max_backlog = 65536 net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.ipv4.tcp_rmem = 4096 87380 67108864 net.ipv4.tcp_wmem = 4096 65536 67108864 net.ipv4.tcp_congestion_control = bbr net.core.default_qdisc = fq net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_sack = 1 net.ipv4.tcp_max_syn_backlog = 30000 fs.file-max = 524288
Apply with sysctl --system. The most impactful change is enabling BBR (Bottleneck Bandwidth and Round-trip time) congestion control along with the fq queueing discipline. BBR was developed by Google and significantly outperforms the default Cubic algorithm on high-bandwidth-delay-product paths that characterize Tor circuit routing.