Site icon New Generation Enterprise Linux

Stop your Linux box from being a lazy worker on network writes

Performance Tuning & Kernel Parameters (Sysctl)

Stop your Linux box from being a lazy worker on network writes

đź§© The Challenge

You know that feeling when your database starts choking during a write-heavy spike and the disk I/O looks perfectly fine? It’s usually because the kernel is hoarding dirty memory pages and suddenly forces a massive, blocking sync that kills your latency.

đź’ˇ The Fix

You need to tell the kernel to start writing those pages to disk much earlier so it doesn’t get overwhelmed and hit the panic button later. It keeps your responsiveness smooth even when the write load gets spicy.

sysctl -w vm.dirty_background_ratio=5
sysctl -w vm.dirty_ratio=10

⚙️ Why It Works

Dropping these values from the usually high defaults forces the background flusher threads to wake up sooner and trickle data to disk instead of waiting for a giant pileup. It’s the difference between a steady flow and a massive, system-locking traffic jam.

🚀 Pro-Tip: Set these in /etc/sysctl.conf to make them stick, but keep an eye on your iostat output afterward to ensure your disks can actually keep up with the new cadence.

Linux Tips & Tricks | © ngelinux.com | 11/8/2026

0 0 votes
Article Rating
Exit mobile version