5

A lot of material on ZFS mentions that basically the more memory you can throw at it, the better. However, I plan to use ZFS on a notebook with 16GB of RAM -- while that should be enough for ZFS, I want to be able to use the computer, not serve files from it; in other words, I want applications to be able to use (at least most of) that memory, not the filesystem implementation.

So, to formulate it as a question, how am I to interpret ZFS's memory requirement when it runs on a computer that also runs non-IO-sensitive apps with high memory usage?

3 Answers 3

4

2GB memory is required according to the ZFS on Linux FAQ.

You can also tune the memory requirements by setting the zfs_arc_max parameter:

# cat /etc/modprobe.d/zfs.conf
options zfs zfs_arc_max=4294967296

There are parameters in /sys that shows the zfs settings:

/sys/module/zfs/parameters/zfs_arc_max
/sys/module/zfs/parameters/zfs_arc_min

You can also set which filesystems gets cached using the zfs primarycache setting:

# zfs set primarycache=[all none metadata] zpool/fs
3
  • The /sys/module/zfs/parameters/zfs_arc_max /sys/module/zfs/parameters/zfs_arc_min all show 0 for me? Jun 30, 2014 at 10:33
  • Oh they are runtime settings, whereas the zfs.conf file needs a reboot? Jul 5, 2014 at 3:50
  • 1
    If I understand the FAQ correctly, when compression and de-duplication are not enabled, less than 2GB RAM should also be acceptable.
    – youfu
    Nov 9, 2018 at 8:43
6

While ZFS will use as much memory as it thinks useful to cache stuff, it will give it back to applications should there is demand for it.

Note that other file systems will also take as much memory as they need as cache. The main difference is that memory is immediately available for applications. With ZFS, there is a slight delay but that should make no difference unless either you have an application that wants to use memory faster than ZFS can release it or that takes into account the reported free memory (+buffer/cache) and refuse to start if there isn't enough available.

In such case and if you know in advance the memory footprint required by your applications, you can set the arc max size tuning value to reserve some RAM.

3

I'm running zfs on Linux on my server with 8gb of ram. True to the docs, it does consume most of the ram. However, I've noticed no performance difference running memory-heavy applications. It would appear that if you need the memory zfs happily gives it up to use. Get used to seeing ridiculous memory in use percentages though.

You must log in to answer this question.

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