Site icon New Generation Enterprise Linux

Stop your high-concurrency apps from dropping packets under load

Performance Tuning & Kernel Parameters (Sysctl)

Stop your high-concurrency apps from dropping packets under load

đź§© The Challenge

Dealing with a production app that suddenly starts dropping TCP connections like they’re toxic even though the CPU is barely idling? You’ve likely hit the backlog limit for the listen queue and the kernel is just throwing those packets away before your app even sees them.

đź’ˇ The Fix

Increase the depth of the TCP listen backlog so your server can actually hold onto new connection attempts long enough for the application to accept them. It saves you from those frustrating “connection refused” errors when traffic spikes.

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

⚙️ Why It Works

By default, these values are often tuned for ancient hardware, so bumping them allows the kernel to buffer more pending connections in memory instead of immediately resetting the client.

🚀 Pro-Tip: Check /proc/net/netstat for ListenDrops to confirm your app is actually the bottleneck before you start cranking these numbers up.

Linux Tips & Tricks | © ngelinux.com | 7/29/2026

0 0 votes
Article Rating
Exit mobile version