Stop your server from forgetting who you are under high load

Performance Tuning & Kernel Parameters (Sysctl)

Stop your server from forgetting who you are under high load

🧩 The Challenge

You’re running a busy web server and suddenly your logs are screaming about connection refused, even though the CPU is barely idling. I’ve wasted a whole night tracking down a flood of SYN packets that were just hitting a wall because the OS didn’t have enough room to queue them up.

💡 The Fix

Bumping up your net.core.somaxconn and tcp_max_syn_backlog allows your app to handle those sudden bursts of traffic without dropping connections at the handshake level.

sysctl -w net.core.somaxconn=4096
sysctl -w net.ipv4.tcp_max_syn_backlog=4096

⚙️ Why It Works

By increasing these values, you’re basically telling the kernel to quit being so stingy with its listen queue and start holding onto more pending connections until the application process can actually handle them.

🚀 Pro-Tip: Check your app’s internal queue settings too, otherwise you’re just shifting the bottleneck from the kernel to your code.

Linux Tips & Tricks | © ngelinux.com | 9/9/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted