Site icon New Generation Enterprise Linux

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 web server logs and see random connection resets when your traffic just barely bumps up? I spent half a Saturday thinking the app was crashing when it was just the kernel dropping incoming requests because the backlog was way too small for modern traffic.

💡 The Fix

Bumping up your net.core.somaxconn and tcp_max_syn_backlog values in sysctl will stop the kernel from silently tossing connections when things get busy. It basically gives your server a bigger waiting room for handshake requests.

sysctl -w net.core.somaxconn=4096
sysctl -w net.ipv4.tcp_max_syn_backlog=4096
# Make it stick by adding these to /etc/sysctl.conf and running sysctl -p

⚙️ Why It Works

By increasing these limits, you allow the kernel to queue more pending TCP connections before it hits that brick wall where it starts sending RST packets to anyone trying to connect. Most distributions set these ridiculously low by default, assuming you’re running a toy app from 2005.

🚀 Pro-Tip: Check your listen queue stats with ss -lnt to see if you are actually dropping connections right now.

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

0 0 votes
Article Rating
Exit mobile version