sysctl.si › Parameters › vm.dirty_ratio

vm.dirty_ratio

Percent of RAM that may hold unwritten data before writers are forced to wait.

Default
20
Typical value
10 on databases

When to change it

Lower values make writers wait sooner but keep latency spikes smaller. Raising it can improve throughput, at the risk of long stalls when the cache is finally flushed.

Check the current value

sysctl vm.dirty_ratio

Change it until the next reboot

sudo sysctl -w vm.dirty_ratio=10

Make it permanent

echo "vm.dirty_ratio = 10" | sudo tee /etc/sysctl.d/99-custom.conf
sudo sysctl --system

Related parameters

vm.swappiness · vm.dirty_background_ratio · vm.overcommit_memory · vm.max_map_count · vm.min_free_kbytes · vm.nr_hugepages

Generate a full sysctl config for your server

Values are starting points. Test on a staging machine and measure before and after.