9

I am currently setting up a file server and have come to the point of actually setting up the data drives. The system has 4 drives (one OS disk, 3 data disks). The OS disk is formatted as ext4 and won't be added to the ZFS pool (if I Choose to run ZFS).my main concern is data integrity and minimum risk of data loss(drive caching is disabled in bios) . For this ZFS seems to be the perfect candidate, since it has a stable version for Linux (correct?), and supports data duplication, pooling and raidz, where the hard-drives don't have to be the same size.

But here is my problem. The server only has 2GB of RAM and this cannot be upgraded in the near future, and realistically only 1.5 will actually be accessible to ZFS after I install all the other services. A maximum of about 10 clients will use it at any one time (more like 4 on average). Is this too low to be considered safe?

From what I understand ZFS can crash in a low RAM situations and take the pool with it. I heard confliciting opinions whether swap will help in alleviating this problem (I have a 20 GB swap dedicated drive). Has anyone experienced data loss with ZFS with little RAM and what optimizations did you include to prevent that?

Bearing in mind the above would it be possible to still run ZFS, albeit reduce ack size and trim it down a bit or will this be too risky?

System specs: 2GB RAM 20GB swap drive OS, Debian 7, minimal install, with FTP, and XBMC, DNLA, (to give an idea of the RAM requirement). Used for storage server and music media streaming to other devices.

  • 1
    I am not a ZFS guru, but I know a fair bit about filesystems in general, and I know one place you'll have to look out -- big time -- for memory consumption is data deduplication. You don't specify how big your disks are, nor how much data will reside on them; this is huge, as ZFS needs to keep an in-memory lookup table. I can't speak to other concerns, but I'd definitely kill deduplication. Also, btrfs is fairly mature for backed-up data, now; have you considered it? Check arstechnica.com/civis/viewtopic.php?f=16&t=1226135 for some insights (which some will no doubt disagree with). – ravenpi Feb 21 '14 at 4:08
  • Oh yes I missed that out. The pool will be 3.35tb(both disks and data, as it will be backing up 9 clients daily so I guess it will fill up quick , I guess that means no duplication at the least, since freebsd suggest 5gb ram for every tb storage space. thanks for pointing out btrfs, I was not aware that it was now stable, I guess I will have a good look into it. – Thomas E Feb 21 '14 at 7:49
  • "Stable" is something I might not rush to call it; one is hesitant to call ANY even kinda-sorta newish filesystem "stable." But it's getting there. LWN (Linux Weekly News) just did a series on it; it's good -- check it out here: lwn.net/Articles/576276 – ravenpi Feb 21 '14 at 21:52
5

You state data integrity and minimum risk of data loss as main concerns. Running ZFS with only 2GiB of memory is risky and not advisable. Too little RAM kills the performance and was the cause of numerous unmountable pools in the past. The FreeNAS project states 8GiB of RAM as a minimum.

Furthermore, since your concern is data loss, you will want to use ECC RAM. Since your box can only support 2GiB of RAM I assume it's a really old box which would not be a good choice for ZFS.

To answer your questions:

[…] and supports data duplication

In practice forget about deduplication when you don't have at least 32GiB, just as a rule of thumb. You might need significantly more RAM, depending on the pool size. Second, do the math if deduplication + RAM costs is cheaper than a handful of additional disks. More often than not, more disks are the cheaper alternative.

Is this too low to be considered safe?

Yes, it's far too low.

From what I understand ZFS can crash in a low RAM situations and take the pool with it.

That's true and many people have lost their pools due to low RAM.

I heard confliciting opinions whether swap will help in alleviating this problem

Forget about swap, your ZFS box should never use swap.

EDIT: If you're feeling adventurous and don't mind the risk of occasional panics or data loss read the ZFS tuning guide and adapt the mentioned settings. Here the example settings for a system of 768MiB of memory.

vm.kmem_size="330M"
vm.kmem_size_max="330M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"

Otherwise invest a hundred bucks in a strip of memory and enjoy a stable and performant system.

  • 3
    I see. Just to elaborate yes I do have ecc ram and the machine is the hp proliant microserver gen7, which supports up to 8/16gb ram, it is just currently not financially viable to purchase more ram. I was aware that freenas recommended 8 gb, however the freebsd and Solaris documentation suggests 1 gb as minimum, which is the reason for the question. I guess in light of this I should stick with ext4 and mirror manually with rsync and dd to offline disk(s), probably the safest solution. – Thomas E Feb 21 '14 at 11:56
  • Can you elaborate on why ZFS should not use SWAP? – CMCDragonkai Jun 5 '14 at 9:26
  • There is no reason using ZFS without ECC is more dangerous than running the same hardware with another filesystem. – Alicia Jun 16 '16 at 1:33
  • 3
    Why is the ZFS community always commenting with such arrogant snobbery? Not everyone who wants reliable data hat $100 just lying around to serve some utterly ridiculous design requirements! I, for example, have a small ARM home server with 1GB hard-wired RAM, and USB hard drives. I want the data on it to be safe from bit rot, by it being both detected and corrected, and have snapshots for backup purposes. There is no need for speed. And btrfs is plain broken by design. So ZFS would be sensible, if some idiot hadn’t designed it to implode from depression whenever it has <128 exabyte of RAM. – Evi1M4chine Jan 28 '17 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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