I am using Debian 8.0 x64 with 72 GB of RAM with 4 drives configured as software RAID 0.

Linux s1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux

I tried setting dirty pages to 2GB cache before actual writing. I also tried setting the "dirty_ratio" and "dirty_background_ratio" settings to use 50% of RAM but that didn't work either. The pdflush daemon should start every minute and expire time for dirty pages was set to 10 minutes.

I checked the disk I/O using "iotop" and it showed disk a high writing activity. Also "cat /proc/meminfo" showed that the "Dirty" value is getting smaller (probably due to writing). Before checking I ran "sync" and "drop_caches". I tested using the "dd" command writing a 1GB file of zeroes.

  • Here are the settings:

echo 0 > /proc/sys/vm/dirty_background_ratio

echo 2147483648 > /proc/sys/vm/dirty_background_bytes

echo 0 > /proc/sys/vm/dirty_ratio

echo 2147483648 > /proc/sys/vm/dirty_bytes

echo 6000 > /proc/sys/vm/dirty_writeback_centisecs

echo 30000 > /proc/sys/vm/dirty_expire_centisecs

  • Mount options:

/dev/md0 on /test type ext4 (rw,noatime,nodiratime,nobarrier,stripe=512)


  • It's not documented in man proc, but try fooling with /proc/sys/vm/vfs_cache_pressure - I'm using that on some machines with huge directories. Default is 100, more than that (like 150) will encourage the OS to flush the cache more, less than that will make it bigger. You don't get to set an exact amount though. Jun 17, 2015 at 22:54
  • Also did you check /proc/slabinfo? That usually has good info on what your cache is doing Jun 17, 2015 at 22:55
  • I set vfs_cache_pressure to 1 and 0 and that did not help. However, caching the file works on the first write. If I run the same dd command with the same filename it forces the cache to be written... why? Jun 17, 2015 at 23:40
  • Another thing, if I set the dirty settings using ratio the system will start writing as soon as I start, but when I use the bytes option the system caches the write (until I try to write the same file again) Jun 17, 2015 at 23:58

2 Answers 2


Try to increase md/stripe_cache_size here file which you have to create

KERNEL=="md*", ACTION=="add", TEST=="md/stripe_cache_size", ATTR{md/stripe_cache_size}="8192"

It worked for me on Raid-6

And I suggest you to reduce dirty ratio because it caused me problems on x64 system I use this settings

add to /etc/sysctl.conf

vm.dirty_bytes = 16777216 #16Mb
vm.dirty_background_bytes = 835584 #mb

Don't use dd for this testing. Use other commands like cp and you will see your write cache working alright.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .