2

I want to setup Debian system with ZFS as primary filesystem and some as secondary (ntfs, ext2/4). When I'll read/write from non-ZFS filesystems pagecache will grow and will force zfs arc to shrink. I don't want this behavior. How to keep linux pagecache minimal? /proc/sys/vm/dirty_* is for controlling dirty cache only. /proc/sys/vm/vfs_cache_pressure is for something (I don't remember correct names) but not pagecache.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Daniil
  • 21
  • 3
  • 1
    If you do not want that the arc shrinks, set the `zfs_arc_max` and `zfs_arc_min` to a value that makes sense for your setup. – Thomas Nov 04 '17 at 18:14

1 Answers1

0

Are you sure the ARC will shrink when the you access/read/write files in non-ZFS file systems? I don't think that is necessarily true..

The page cache uses free memory to cache files that you access, ZFS ARC memory isn't free, it's claimed by the ARC and ARC reclaim is mostly managed by ZFS.

If you are writing the programs that are accessing files you can look into fadvise with POSIX_FADV_DONTNEED

If you don't let the page cache do what it's supposed to do, you are probably going to see increased IO due to poor cache hit-rate. If you're not doing enough non-ZFS I/O for that to matter, then the amount of memory it uses shouldn't matter.

You can also drop the page cache when needed with /proc/sys/vm/drop_caches

Gregg Leventhal
  • 7,480
  • 19
  • 65
  • 100