Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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
share|improve this answer
    
The /sys/module/zfs/parameters/zfs_arc_max /sys/module/zfs/parameters/zfs_arc_min all show 0 for me? –  CMCDragonkai Jun 30 at 10:33
    
Oh they are runtime settings, whereas the zfs.conf file needs a reboot? –  CMCDragonkai Jul 5 at 3:50

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.