Stop your network stack from dropping packets when the load spikes

Performance Tuning & Kernel Parameters (Sysctl)

Stop your network stack from dropping packets when the load spikes

🧩 The Challenge

You know that feeling when your web server gets hammered and the logs start showing mysterious connection resets? It is usually the kernel’s internal queue getting overwhelmed before your app even sees the traffic.

💡 The Fix

Crank up the maximum connection backlog to stop the kernel from preemptively killing new requests. This gives your application enough breathing room to actually pull the connections off the wire.

sysctl -w net.core.somaxconn=4096

⚙️ Why It Works

Bumping this value tells the networking stack to stop rejecting SYN packets when your application processes are momentarily busy. You might also need to adjust your app configuration to actually listen to that larger queue.

🚀 Pro-Tip: Check your current max with sysctl net.core.somaxconn before making changes so you know how far off the default you really are.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted