Stop your network stack from dropping packets under load
Performance Tuning & Kernel Parameters (Sysctl)
Stop your network stack from dropping packets under load
🧩 The Challenge
Dealing with a burst of traffic and watching your application logs fill up with connection errors is the absolute worst. You check the CPU and it’s barely sweating, but the network stack is silently nuking your connections because the backlog is just too shallow.
💡 The Fix
Crank up your listen backlog limit so the kernel doesn’t toss incoming connections into the void when your application worker threads are momentarily busy. It’s a quick tweak that stops those phantom drops during traffic spikes.
sysctl -w net.core.somaxconn=4096
sysctl -w net.ipv4.tcp_max_syn_backlog=4096
⚙️ Why It Works
By increasing these values, you’re effectively expanding the waiting room for incoming TCP connections before they’re accepted by your application. The default limits are usually laughably small for any production server handling actual traffic.
🚀 Pro-Tip: Don’t forget to update your app config too, or it might still be hardcoded to accept fewer connections than the kernel is allowing.
Linux Tips & Tricks | © ngelinux.com | 10/5/2026
