1

I am regarding to question: Improving IO with FlashCache

I have setup a RAID1 (/dev/md0) LVM (/dev/vg_xen) and executed following command:

flashcache_create -p thru flashcache0 /dev/sdc /dev/md0

Then I started a XEN PV guest, which uses /dev/vg_xen/vm0 as hard disk. After using it a while

cat /proc/flashcache/sdc\+md0/flashcache_stats

shows me

reads=0 writes=0

So, it does not work. What did I do wrong?

user1091344
  • 279
  • 3
  • 9

1 Answers1

2

You should make sure that your LVM is using the /dev/mapper/flashcache0 device as its physical volume instead of using /dev/md0 directly (in the latter case flashcache would not be involved in the I/O code path at all).

See http://sf-alpha.bjgang.org/wordpress/2012/11/flashcache-initscripts/ for a handy script on how to set this up, if you have not done so yet. The basic outline would be:

  1. exclude /dev/md0 from being detected through LVM by adding filter = [ "r|/dev/md0|" ] and commenting out or removing filter = [ "a/.*/" ] (if present) from the devices{} section of your /etc/lvm/lvm.conf
  2. use the flashcache_create (or flashcache_load if using write-back caching mode) command to create your flashcache-backed device
  3. run vgscan to discover your volume group and activate it by issuing vgchange -ay vg_xen

For details on flashcache configuration, refer to the admin guide which came with your flashcache download.

the-wabbit
  • 40,319
  • 13
  • 105
  • 169