Stop your server from ignoring half your available connections

Performance Tuning & Kernel Parameters (Sysctl)

Stop your server from ignoring half your available connections

🧩 The Challenge

You ever look at your server logs and see connection resets just because the app got a tiny bit busy? It’s usually because the kernel’s backlog queue is way too small for modern traffic.

💡 The Fix

Crank up the net.core.somaxconn parameter to handle a bigger burst of incoming connections before they get tossed in the trash. This gives your application enough breathing room to actually accept the socket before the kernel panics.

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

⚙️ Why It Works

By increasing this limit, you’re telling the kernel to allow a larger queue of pending connections that haven’t been accepted by the application yet. Most distros ship with a default of 128, which is just pathetic for anything running in production these days.

🚀 Pro-Tip: Check your application code too, because some frameworks have their own internal backlog limit that ignores the kernel settings.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted