Background
I recently bought a few servers in physically distant locations — the US West Coast, Germany, and so on. Testing with iperf3 and speedtest showed severe single-thread download throttling (around 200Mbps). The pattern tracks latency: at 160ms the cap sits around 200Mbps, at 150ms around 220Mbps — the higher the latency, the tighter the cap and the lower the throughput.
The Current Defaults
Since macOS 10.5, Apple has shipped “self-tuning TCP”, which dynamically adjusts certain parameters for performance. The defaults have improved over the years, but they still need tweaking to make full use of fast connections.
Recent macOS versions ship with the following defaults (exact values vary slightly by version):
net.inet.tcp.win_scale_factor: 3net.inet.tcp.autorcvbufmax: 4194304net.inet.tcp.autosndbufmax: 4194304
Recommended Settings for Fast Connections
To optimize performance on 1Gbps-or-faster networks, raise the TCP window scaling factor and the autotuning buffer maxima. Add the settings below to /etc/sysctl.conf (or apply them on the fly with the sysctl command):
Modify net.inet.tcp.win_scale_factor, net.inet.tcp.autorcvbufmax, and net.inet.tcp.autosndbufmax.
How to Apply
sudo nano /etc/sysctl.conf- Add the following:
# Increase TCP window scaling factor (default is 3-6; increase to 8)net.inet.tcp.win_scale_factor=8
# Increase maximum receive buffer for TCP autotuning to 32MBnet.inet.tcp.autorcvbufmax=33554432
# Increase maximum send buffer for TCP autotuning to 32MBnet.inet.tcp.autosndbufmax=33554432- Save, then run
sudo sysctl -f /etc/sysctl.conf
Results
Defaults
iperf3 test

speedtest test

After the Change
iperf3 test

speedtest test

WARNING
- These settings are well suited to high-performance workloads — file servers, high-throughput applications, or research environments.
- If they cause instability or hurt performance in your specific use case, revert them.
- If iperf3 shows heavy Retr packet loss after the change, tune the macOS buffer sizes, or adjust the TCP buffer sizes on the VPS side.