Site icon New Generation Enterprise Linux

Stop your TCP stack from dropping connections under load

Performance Tuning & Kernel Parameters (Sysctl)

Stop your TCP stack from dropping connections under load

đź§© The Challenge

You know that feeling when your web server gets hit by a minor traffic spike and suddenly you start seeing connection reset errors in your logs? It usually happens because the syn backlog queue is just way too small for modern workloads, and nobody tells you that the default is often stuck in the dark ages.

đź’ˇ The Fix

Bumping up the SYN backlog and tweaking the recycling settings helps your server handle sudden bursts without immediately turning away legitimate users. It saves you from that panicked “why is the site down” moment at 3 AM.

sysctl -w net.ipv4.tcp_max_syn_backlog=4096
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.core.somaxconn=1024

⚙️ Why It Works

These settings effectively widen the waiting room for incoming connections, letting the kernel hold more half-open requests before it starts tossing them out the window. Syncookies act as your last line of defense when the queue actually fills up, preventing a complete drop-off.

🚀 Pro-Tip: Check your listen queue stats with netstat -antp | grep LISTEN; if you see Send-Q numbers consistently hitting your current max, you’re already dropping traffic.

Linux Tips & Tricks | © ngelinux.com | 8/30/2026

0 0 votes
Article Rating
Exit mobile version