Stop your network buffer from dropping packets when the traffic spikes
Performance Tuning & Kernel Parameters (Sysctl)
Stop your network buffer from dropping packets when the traffic spikes
🧩 The Challenge
Dealing with a production app that suddenly chokes on bursts of traffic is a nightmare. I spent three days debugging dropped packets before realizing the default Linux receive buffer was just too tiny for the queue.
💡 The Fix
Bumping up the network receive queue buffer sizes via sysctl prevents the kernel from dropping packets when your app is momentarily busy. It’s a quick win for high-throughput services.
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.rmem_default=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w net.core.wmem_default=16777216
⚙️ Why It Works
Increasing these values tells the kernel to allocate more memory for incoming and outgoing data, which gives your application a bigger cushion to handle those erratic traffic bursts. Without this, the buffers fill up in milliseconds and you lose data before it even reaches your process.
🚀 Pro-Tip: Always make these changes permanent in /etc/sysctl.d/99-network-performance.conf so you aren’t chasing the same ghost after a reboot.
Linux Tips & Tricks | © ngelinux.com | 10/17/2026
