Performance Tuning & Kernel Parameters (Sysctl)
Stop letting your network buffer bloat destroy your latency
🧩 The Challenge
Dealing with a web server that suddenly turns into molasses whenever a big file transfer hits the wire is the absolute worst. You stare at your bandwidth stats and everything looks fine, but users are complaining about latency spikes that shouldn’t be happening.
💡 The Fix
Tweak the TCP autotuning limits and the congestion control algorithm to prevent buffers from holding onto packets longer than they need to. It keeps your traffic flowing smoothly instead of letting it stack up in a giant, congested pile.
sysctl -w net.ipv4.tcp_congestion_control=bbr
sysctl -w net.ipv4.tcp_rmem="4096 87380 16777216"
sysctl -w net.ipv4.tcp_wmem="4096 65536 16777216"
⚙️ Why It Works
Moving to BBR instead of the default CUBIC makes a massive difference because it models the actual bottleneck bandwidth rather than just reacting to packet loss. And adjusting the window sizes prevents the kernel from being too greedy with memory allocation on high-speed connections.
🚀 Pro-Tip: Use sysctl -p to make these changes stick after a reboot or you will be back here doing this all over again on Monday.
Linux Tips & Tricks | © ngelinux.com | 9/29/2026
