Performance Tuning & Kernel Parameters (Sysctl)
Stop your server from punting packets when the network spike hits
🧩 The Challenge
Dealing with a production web server that starts dropping connections the second traffic hits a minor spike is infuriating. You keep checking your load, but the box isn’t even breaking a sweat, yet your users are seeing 503s everywhere.
💡 The Fix
Increase the size of the receive queue backlog to give your NIC a fighting chance to process bursts before the kernel drops them on the floor. It’s an easy tweak that stops the kernel from panicking under pressure.
sysctl -w net.core.netdev_max_backlog=5000
sysctl -w net.core.somaxconn=1024
⚙️ Why It Works
Increasing netdev_max_backlog lets your CPU queue more packets from the NIC buffer when the kernel is busy, while somaxconn increases the limit for the listen queue so your application can actually keep up with incoming handshake requests.
🚀 Pro-Tip: Always make these changes permanent in /etc/sysctl.conf unless you want to be troubleshooting this again after the next reboot.
Linux Tips & Tricks | © ngelinux.com | 11/19/2026
