Site icon New Generation Enterprise Linux

Stop your Linux box from being a terrible neighbor on the network

Performance Tuning & Kernel Parameters (Sysctl)

Stop your Linux box from being a terrible neighbor on the network

đź§© The Challenge

Dealing with a server that suddenly stops responding because it’s trying to track thousands of half-open TCP connections is a nightmare. It happens when you’re under a SYN flood or just have a badly behaving load balancer, and it’ll wreck your uptime while you’re scrambling to find the culprit.

đź’ˇ The Fix

Crank up your TCP SYN backlog and shorten the timeout so the kernel dumps those stale connections before they kill your memory. You’ll keep your services snappy even when the network is acting like a dumpster fire.

sysctl -w net.ipv4.tcp_max_syn_backlog=4096
sysctl -w net.ipv4.tcp_synack_retries=2
sysctl -w net.ipv4.tcp_syncookies=1

⚙️ Why It Works

Pushing the backlog higher gives the kernel more breathing room to queue pending connections, while cutting the retries prevents those hanging handshakes from eating up resources forever. Turning on SYN cookies acts as a fallback for when the system is actually under heavy load, ensuring legit traffic doesn’t get tossed out.

🚀 Pro-Tip: Don’t forget to make these changes permanent in /etc/sysctl.d/99-networking.conf or they’ll vanish the second you reboot.

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

0 0 votes
Article Rating
Exit mobile version