Pfsense 2.4 ZFS File System
-
Shouldn't be much more resource intensive aside from needing more memory. ZFS loooves memory and will use every bit it can grab.
It can be made to work on low memory systems with some tuning but that's far beyond the scope of my knowledge. Where's Allan Jude when you need him? :D
-
Yes, it loves memory but it does not NEED it. It can and does run fine in a Gig or two.
This is a common falsehood and scares alot of people off.
ZFS will utilise available free memory and release memory as other processes need it.
People really need to stop spreading this rumour!
https://docs.oracle.com/cd/E18752_01/html/819-5461/gbgxg.html
ZFS Hardware and Software Requirements and Recommendations
Ensure that you review the following hardware and software requirements and recommendations before attempting to use the ZFS software:Use a SPARC or x86 based system that is running at least the Solaris 10 6/06 release or later release.
The minimum amount of disk space required for a storage pool is 64 MB. The minimum disk size is 128 MB.
The minimum amount of memory needed to install a Solaris system is 768 MB. However, for good ZFS performance, use at least one GB or more of memory.
If you create a mirrored disk configuration, use multiple controllers.
-
Mostly true, ZFS is not memory intensive or a resource hog any more than your average database can be depending on the setup. There's one thing I'm worried about and that's the high amount of incorrect information on the net concerning the more advanced features of ZFS such as dedup. You can expect an influx of newbies asking why their pfSense locked up hard when they enabled dedup just for the fun of it.
-
Yep. No need for dedup in any normal system and the memory needs are freaking INSANE for your average 10's of terrabyte storage systems. No person in their right mind would enable this if they did not know what they were doing.
The other things newb's all do is smack in a zil and L2ARC thinking they're cool…um, no...your not and at best, you'll likely slow down your system rather than speed it up.
ZFS is an amazing thing, but stupid is even more amazing.
-
What are the advantages of ZFS in a pfsense install? My understanding is that ZFS is like an advanced software RAID file system. So wouldn't ZFS either increase storage speed, reliability or both depending on how you set it up?
I could certainly see the advantage of reliability increase in a production system, would you install multiple drives for redundancy?
Where (other than squid caching) would pfsense really benefit from storage speed increases?
I'm not looking for anything specific or in depth, I was just curious as to what some general use-cases for ZFS in pfsense would be and the very basics of how they would be implemented?
I'm new to pfsense, and love it. I'm also interested in setting up a FreeNAS server at some point in the future. I have no IT background at all but came upon both pfsense and freenas separately without knowing they were both based on FreeBSD. So now I'm interested in learning FreeBSD itself so that I can better understand and use both pfsense and FreeNAS in the future.
I've installed a FreeBSD VM and am exploring it as I read through the manual, but haven't made it to ZFS yet. ZFS seems like one of the crown jewels of FreeBSD so I'm interested to learn your thoughts on it. -
What are the advantages of ZFS in a pfsense install?
Unlike UFS, it doesn't crash and burn, bricking your boxes over and over again. That's enough of an advantage for me.
-
What are the advantages of ZFS in a pfsense install?
Unlike UFS, it doesn't crash and burn, bricking your boxes over and over again. That's enough of an advantage for me.
There is a decent amount of stuff out there on the web recommending against using ZFS in a single file system. Do you or anyone on this forum have any advice or knowledge to share on using ZFS in a single drive system (which I assume most pfsense installs are), and why it's better than UFS?
-
What are the advantages of ZFS in a pfsense install?
Unlike UFS, it doesn't crash and burn, bricking your boxes over and over again. That's enough of an advantage for me.
There is a decent amount of stuff out there on the web recommending against using ZFS in a single file system. Do you or anyone on this forum have any advice or knowledge to share on using ZFS in a single drive system (which I assume most pfsense installs are), and why it's better than UFS?
Are you actually reading? ::)
https://redmine.pfsense.org/issues/6891
https://redmine.pfsense.org/issues/6340
https://redmine.pfsense.org/issues/5592
https://redmine.pfsense.org/issues/4523(And yes UFS is so bad I've actually written a howto on using ZFS on 2.2.x)
-
Cool, thanks! So you set two copies for single disk. Good to know.
-
whilst zfs may not be perfect, if you after reliability it's a significant improvement over ufs.
Its not been run ideally if you have just one storage device but I would still prefer it over ufs.
-
when this is released will we be able to upgrade to ZFS from 2.3.x or will it require a reinstall?
-
when this is released will we be able to upgrade to ZFS from 2.3.x or will it require a reinstall?
I doubt that you'll be able to avoid a full reinstall, there just aren't any tools that would automate an UFS to ZFS conversion.
-
Would installing pfsense (full install, not NanoBSD) using ZFS to a pair of mirrored 4GB SLC USB 2.0 thumbdrives be an extremely durable/reliable configuration?
Certainly not cheap at all, but wouldn't take any SATA slots, would be low power and would in theory give the durability of SLC combined with benefits of ZFS installed on two drives.
EDIT: While the SLC would in theory be the most durable setup, It costs so much money that it wouldn't make sense for most users. Another option that I would think would make WAY more sense would be using USB 3.0 non-SLC flash drives.
A combo of say 2x16GB or even 4x8GB drives would satisfy just about the most paranoid user, be extremely reliable and fast at very low power draw and remain extremely cheap.Basically I'm wondering if this general type of install will be fully supported in upcoming pfsense versions?
-
the size of the flash storage is also important for durability and 4 gig of it is a very small amount.
e.g. my pfsense unit is doing 5+ gig writes a day to my ssd (yes I am going to investigate why is so high), if I was using those usb sticks that would be an erase cycle every single day.
Also do usb devices have robust wear levelling tech which requires a decent controller. If you willing to use usb ports for the primary storage, then its probably better to get a couple of ssd's and then connect them via a usb to sata adaptor.
I also concur on the memory usage for zfs.
on my pfsense unit the ZFS ARC is only using 438meg of ram.
-
the size of the flash storage is also important for durability and 4 gig of it is a very small amount.
e.g. my pfsense unit is doing 5+ gig writes a day to my ssd (yes I am going to investigate why is so high), if I was using those usb sticks that would be an erase cycle every single day.
Also do usb devices have robust wear levelling tech which requires a decent controller.
Well if you were to use SLC, you have somewhere in the neighborhood of 30,000 r/w cycles compared to about 500 for TLC which is what a normal USB drive probably uses. https://media.kingston.com/pdfs/MKF_283.1_Flash_Memory_Guide_EN.pdf CTRL+F "SLC"
So if those numbers are to be believed, one SLC drive will last as long as 60 TLC drives, and an SLC drives costs ~12x more than a TLC drive (at $60/4GB SLC v $5/4GB TLC) obviously these numbers are ballpark and you can pay a lot more and a lot less for either option but you get the point. There could be a case to be made for using SLC drives, but probably not for many people.
Your average person would probably get years of use way more capacity out of 2 or 4 16GB SanDisk Cruzer Fits.
https://www.amazon.com/dp/B005FYNSZA/?tag=ozlp-20
At 2 for $18 or 4 for $36 setup in mirrors you have either 16 or 32GB of storage with either 1 or 2 redundant drives.Writes will be very slow at 0.475 or 0.2375 MB/s for 4k writes and about 5x as fast for sequential.
Reads will be way better at 9.14 or 18.28 MB/s for 4k reads and about 4.8x faster for sequential.
http://usb.userbenchmark.com/SpeedTest/2402/SanDisk-Cruzer-FitThese numbers are based off of a slow USB 2.0 drive, obviously if you get better drives you'll get better performance.
Mirrors will get writes at 50% performance for 2 drives, 25% for 4.
Reads will be at 200% for 2 drives and 400% for 4. In theory at least.Ultimately I doubt much of this matters since pfsense is usually just writing logs to the boot drive and doesn't typically rebot often in most scenarios.
I do know that FreeNAS, also based on FreeBSD commonly recommends the SanDisk Cruzer USB 2.0 drives as ZFS boot drives.I'm just wondering if the same setup will also work well on pfsense, or will it for some reason not do well?
Two redundant drives in ZFS for low power draw and <$40 buy in sounds great for a system you'll setup somewhere else and probably never physically see again.
-
By the way I have found the cause of the writes.
7.2megabytes written every minute in /var/db/rrd to update graphing data, thats 480meg an hour. ZFS will reduce the impact tho with compression.
If comparing to ssd's which I advised then many consumer ssd's are MLC not TLC based.
The erase cycle efficiency plummets if there is not decent wear levelling in place.
For the price of those USB sticks one can get a 60gig MLC drive. So I think thats a better comparison.
The SLC usb sticks should be quite fast tho :) I own some fast usb sticks, I suspect they are at least MLC flash and that is how the speed increased was achieved over my cheaper usb sticks which are almost certainly TLC.
-
Going from a pre 2.4 version to 2.4, to use ZFS, does that require a fresh install, or can the file system be converted during the 2.3.3 to 2.4 process?
-
Going from a pre 2.4 version to 2.4, to use ZFS, does that require a fresh install, or can the file system be converted during the 2.3.3 to 2.4 process?
There are no UFS to ZFS conversion tools that I know of, at least for FreeBSD so you very likely will have to do a clean install and restore the config.
-
Going from a pre 2.4 version to 2.4, to use ZFS, does that require a fresh install, or can the file system be converted during the 2.3.3 to 2.4 process?
You would need a second storage device and it would be a manual process, there is no automated tool.
So the process would be something like this.
Connect new storage
Load zfs kernel module
Configure zfs on new storage, remembering to also do bootloader and enable zfs in loader.conf modify fstab etc.
Migrate data to new storage.
Boot off new storage.Done
Probably easier to just reinstall pfsense given the backup and restore feature makes it a whole lot quicker.
-
I'm wondering if ZFS on a flash drive will produce similar results that it did when FreeNAS switched to 9.3 and ZFS for the boot drive. Scrubs will show any errors and it uncovered just how inherently unreliable USB flash drives really are.
I would think a sensible move would be to invest in a cheap SSD for a boot drive if you want to run ZFS and 2.4 and have a reliable system. But it's just a guess at this point.