Stop your server from dropping connections when things get noisy
Performance Tuning & Kernel Parameters (Sysctl)
Stop your server from dropping connections when things get noisy
🧩 The Challenge
You’ve probably seen your app start dropping connections during a sudden traffic spike, even when CPU and memory usage look perfectly fine. It’s usually the kernel silently binning incoming requests because the backlog queue is just too small to handle the surge.
💡 The Fix
Bumping up the maximum number of half-open connections in the kernel buffer stops these random connection resets. It’s an easy sysctl tweak that buys your web server some breathing room.
sysctl -w net.ipv4.tcp_max_syn_backlog=4096
sysctl -w net.core.somaxconn=4096
⚙️ Why It Works
These parameters define how many requests the kernel will queue up for the application before it starts sending RST packets to clients. Raising these numbers prevents your server from turning away valid users just because the application process wasn’t fast enough to accept the socket instantly.
🚀 Pro-Tip: Check your application’s own listen backlog setting too, because the kernel can only queue as much as your code is willing to process.
Linux Tips & Tricks | © ngelinux.com | 10/8/2026
