# View/monitor several settings
cat /etc/sysctl.conf | egrep "dirty|writeback" # config file's dirty, if loaded.
cat /proc/vmstat | egrep "dirty|writeback" # print dirty
cat /proc/vmstat | egrep "nr_" # print all nr
# View/monitor several settings : dynamic
watch grep -A 1 dirty /proc/vmstat
# Soft edit dirty ratios
sudo sysctl vm.dirty_background_ratio=50 # set variable's value
sudo sysctl vm.dirty_ratio=80 # set variable's value
# Hard edit config file
sudoedit /etc/sysctl.conf # hard edit config file.
#vm.dirty_background_ratio = 50 # add without the hashtag
#vm.dirty_ratio = 80 # add without the hashtag
# # Save with nano : CTRL+X, then y
sudo sysctl -p # reload current config file. Resets soft variables.
# Objective
Monitor dirty files memory,
Change to more suitable values.
What it does: change from default 10 and 50%.
My understanding: background_ ratio/100) * memory size > largest file size`, then it should be ok.[reference needed]
If `(vm.dirty_
Note: `memory size` may be *available* memory size. Closing your memory-eating browsers may help.[reference needed]
After editing the dirty values, reboot your system. It helped me.
# Sources: /lonesysadmin. net/2013/ 12/22/better- linux-disk- caching- performance- vm-dirty_ ratio/ fooo.fr/ ~vjeux/ github/ github- recommandation/ db/doc/ manual/ html/linux- performance- guide.html
- https:/
- http://
# Helpful commands background_ ratio # default 50
```
# View one dirty setting
sudo sysctl -n vm.dirty_ratio # default 10
sudo sysctl -n vm.dirty_
# View/monitor several settings
cat /etc/sysctl.conf | egrep "dirty|writeback" # config file's dirty, if loaded.
cat /proc/vmstat | egrep "dirty|writeback" # print dirty
cat /proc/vmstat | egrep "nr_" # print all nr
# View/monitor several settings : dynamic
watch grep -A 1 dirty /proc/vmstat
# Soft edit dirty ratios background_ ratio=50 # set variable's value
sudo sysctl vm.dirty_
sudo sysctl vm.dirty_ratio=80 # set variable's value
# Hard edit config file background_ ratio = 50 # add without the hashtag
sudoedit /etc/sysctl.conf # hard edit config file.
#vm.dirty_
#vm.dirty_ratio = 80 # add without the hashtag
# # Save with nano : CTRL+X, then y
sudo sysctl -p # reload current config file. Resets soft variables.
# Check changes
cat /etc/sysctl.conf | egrep "dirty|writeback" #
cat /proc/vmstat | egrep "dirty|writeback" #
```
# Proposed diagnosize for your steps
Before and after changing dirty values.
```
# 1. System is waiting
cat /proc/vmstat | egrep "dirty|writeback"
# 2. Just started copy
cat /proc/vmstat | egrep "dirty|writeback"
# 3. Copy is staled
cat /proc/vmstat | egrep "dirty|writeback"
# 4. Just cancelled copy via mouse
cat /proc/vmstat | egrep "dirty|writeback"
# 5. Waiting = nr_dirt goes down
cat /proc/vmstat | egrep "dirty|writeback"
# 6. Back to normal.
cat /etc/sysctl.conf | egrep "dirty|writeback"
```