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

Dealing with a sudden spike in traffic and watching your backlog fill up is enough to ruin anyone’s Friday night. I’ve spent way too many hours staring at SYN_RECV states while the server just gives up on new requests.

💡 The Fix

Crank up the net.core.somaxconn parameter to allow a much deeper queue for incoming connections. It stops the kernel from immediately rejecting handshakes when the application process is slightly busy.

sysctl -w net.core.somaxconn=4096
echo "net.core.somaxconn=4096" >> /etc/sysctl.conf
sysctl -p

⚙️ Why It Works

The default limit of 128 is a relic from the early 2000s and can’t handle modern web traffic bursts. Increasing this allows the kernel to buffer more connections until your service can actually pull them off the stack.

🚀 Pro-Tip: Don’t forget to update your application code to handle the increased backlog too, or the kernel change won’t actually help.

Linux Tips & Tricks | © ngelinux.com | 11/26/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted