3

For testing I need zfs' cache to be cold.

I can flush caching from the pool by removing the cache disks, exporting and importing the pool. This gives the effect I want. But would really like not to export the pool.

Is there a less drastic way to achieve the same effect?

What I am looking for is the equivalent to:

echo 3 > /proc/sys/vm/drop_caches

which does what I want for ext4.

Background

I can run my algorithm in different ways. I do not care about the best-case performance. I do care about worst-case performance. Worst-case would be on cold data (data touched so long ago that it is no longer in ARC/L2ARC).

To choose the optimal way to run the algorithm, I need to be able to run on the same test set. And this test set must be cold. This goes completely against ZFS' caching strategy: If I run on the same test set again and again, it will put the data into ARC - which makes perfect sense under normal circumstances, but not here.

I can export/import on my developer machine, but I cannot do this in production. Flushing the cache, however, will be acceptable in production.

I will prefer if ARC still works, so the cold data is cached after being read (again similar to ext4), but I can live with ARC completely disabled during the test.

Ole Tange
  • 2,836
  • 5
  • 29
  • 45

0 Answers0