Difference between vm.dirty_ratio and vm.dirty_background_ratio?

Has the higher value of dirty_background_ratio and dirty_ratio any meaning or is it just a matter of “what is the lower value and who has it”?

In simpler words:

vm.dirty_background_ratio is the percentage of system memory which when dirty, causes the system to start writing data to the disk.

vm.dirty_ratio is the percentage of system memory which when dirty, causes the process doing writes to block and write out dirty pages to the disk.

These tunable depend on what your system is running; if you run a large database it’s recommended to keep these values low, to avoid I/O bottlenecks when the system load increases.

e.g.:

vm.dirty_background_ratio=10
vm.dirty_ratio=15

In this example, when the dirty pages exceed vm.dirty_background_ratio=10 I/O starts, i.e they start getting flushed / written to the disk. When the total number of dirty pages exceed vm.dirty_ratio=15 all writes get blocked until some of the dirty pages get written to disk. You can think of the vm.dirty_ratio=15 as the upper limit.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)