Site icon New Generation Enterprise Linux

Stop your Linux box from being a lazy memory hoarder

Performance Tuning & Kernel Parameters (Sysctl)

Stop your Linux box from being a lazy memory hoarder

đź§© The Challenge

Dealing with a server that starts swapping to disk even when there is plenty of perfectly good RAM sitting idle is a special kind of hell. You watch your app latency skyrocket because the kernel decided it prefers disk I/O over keeping your processes in memory.

đź’ˇ The Fix

You need to tweak the swappiness parameter to tell the kernel to stop being so trigger-happy with the swap partition. It’s an easy win that makes a massive difference for database performance.

sysctl -w vm.swappiness=10

⚙️ Why It Works

Dropping that value to 10 effectively tells the kernel to avoid swapping unless it absolutely has to, keeping your active memory pages in RAM where they actually belong. It keeps your disk bus quiet so your CPU isn’t waiting on slow storage.

🚀 Pro-Tip: Stick this in /etc/sysctl.d/99-custom.conf to make the change survive a reboot, or you’ll be doing this all over again next Tuesday.

Linux Tips & Tricks | © ngelinux.com | 9/25/2026

0 0 votes
Article Rating
Exit mobile version