Stop the kernel from throttling your local socket performance
Performance Tuning & Kernel Parameters (Sysctl)
Stop the kernel from throttling your local socket performance
🧩 The Challenge
Dealing with high-throughput microservices on the same box is a total headache when the kernel starts artificially capping how many local connections can hang out in the queue. You’ll see weird latency spikes that make absolutely no sense until you realize your software is bumping into the OS defaults.
💡 The Fix
Bumping up the maximum listen queue backlog prevents your services from dropping connections during minor traffic bursts. It’s an easy win that keeps your local IPC from choking when things get busy.
sysctl -w net.core.somaxconn=4096
⚙️ Why It Works
Setting this value higher tells the networking stack to stop rejecting new connections once the backlog hits the default, which is usually a tiny 128 connections. Most modern apps can handle way more, so this just lets the kernel get out of the way.
🚀 Pro-Tip: Check if your app needs a matching listen backlog tweak in the code, or else this sysctl change won’t actually help.
Linux Tips & Tricks | © ngelinux.com | 11/20/2026
