Performance Tuning & Kernel Parameters (Sysctl)
Stop letting slow disk writes kill your database responsiveness
đź§© The Challenge
You’ve got a database server that starts lagging every time it hits a heavy write burst, and the load average spikes into the triple digits for no good reason. It’s infuriating when the kernel decides to flush all those dirty pages at once and locks up your entire IO stack.
đź’ˇ The Fix
Crank down the dirty background ratio so the kernel starts trickling those writes to disk earlier instead of waiting for a massive dump. You’ll smooth out the latency spikes and keep your applications from hanging during high-write cycles.
sysctl -w vm.dirty_background_ratio=5
sysctl -w vm.dirty_ratio=10
⚙️ Why It Works
By lowering these thresholds, you’re forcing the kernel to wake up the flush threads sooner, which prevents the buffer cache from getting overwhelmed. A smaller target makes the IO throughput way more predictable under heavy load.
🚀 Pro-Tip: Don’t forget to make these permanent in /etc/sysctl.conf or you’ll be doing this all over again after the next reboot.
Linux Tips & Tricks | © ngelinux.com | 8/21/2026
