In a mission to reduce frequent memory flushes to filesystem, I added the following two lines to
vm.dirty_background_ratio = 50 vm.dirty_ratio = 80
I then ran,
sudo sysctl -p and the changes were in effect right way. Upon a system reboot, however, I still see old values for dirty_ratio and dirty_background_ratio.
new-sys-admin@ThinkPad:~$ sysctl -n vm.dirty_background_ratio 10 new-sys-admin@ThinkPad:~$ sysctl -n vm.dirty_ratio 5
I'm running Ubuntu 12.04.3 LTS 3.2.0-52-generic-pae. After looking at a couple of posts:
- Ubuntu way to run sysctl -p on each boot?
- Ubuntu 12.04, why service procps start doesn't start procps?
it looks like the upstart job,
/etc/init.d/procps is supposed to run on system boot and reload
/etc/sysctl.conf contents via
/etc/init/procup.conf but it doesn't seem like it does.
On the next reboot, I ran
service procps start and the changes were in effect. I'm wondering how to make procps run consistently on boot time and if I am missing an additional step in making these changes persistent.
Also tried having these values in
/etc/sysctl.d/10-local.conf as per Bill's suggestion.
new-sys-admin@ThinkPad:~$ cat /etc/sysctl.d/10-local.conf vm.dirty_background_ratio = 50 vm.dirty_ratio = 80
Upon restart, the values are reverted back.