Skip to main content

🚀 Optimizing Linux Swappiness


By default, Linux has a "swappiness" value of 60. Lowering this to 10 tells the kernel to avoid using the slow disk swap and prioritize the fast physical RAM, which is critical for Wazuh Indexer performance.

1

Check Current Swappiness

Run this command to see your current value. It will likely return 60.

sudo cat /proc/sys/vm/swappiness

2

Apply Immediate Change

Use the sysctl command to lower the value to 10 instantly without a reboot.

sudo sysctl vm.swappiness=10

3

Make Change Permanent

Add the configuration to /etc/sysctl.conf so the setting persists after the VM reboots.

sudo echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf


✅ Verification

You have successfully reduced disk I/O wait times for the Wazuh Indexer. This helps prevent the VM from hanging when memory usage spikes during large data ingestions.