Low Latency Notes

Tuning TCP buffers on a small VPS

2026-11-02 · M. Lin

Most cheap VPS images ship with conservative TCP buffer defaults. That is fine for a web server talking to nearby clients, but it hurts the moment you push bulk data across an ocean.

Bandwidth-delay product

The buffer you need is roughly bandwidth × RTT. A 200 Mbit/s path with 180 ms RTT needs about 4.5 MB in flight. The default tcp_rmem max of 6 MB is borderline; tcp_wmem is often lower.

net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 131072 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216

Pair this with BBR and fq and the difference on long paths is dramatic. Measure before and after with iperf3 -R; do not trust a single run.