wiebsomean
Cadet
- Joined
- Dec 22, 2013
- Messages
- 2
There are a lot of forum threads relating to poorer performance running FreeNAS 9.2 versus 8.x, particularly when running ZFS with <8GB RAM. Certainly I experienced woeful performance running 9.2 with a ‘stock install’ on 4GB RAM, but my real world experience suggests FreeNAS 9.2 can be nearly as fast as 8.x with a little prudent tuning, and perhaps a cheap hardware upgrade.
I thought I should share my experience in the hope that it will help others to live a faster life with an under-specced rig and reap all the benefits of the latest build of ZFS with out forking out a lot of cash.
Before my settings were implemented, I was getting only 11- 15MB/s read and write performance from my rig over GigE with just the standard autotune sysctls and tunables set. After applying the settings below, I saw reliable 65 - 70MB/s throughput and rock steady stability.
Firstly let me affirm the oft quoted statement that FreeNAS 9.2 needs a minimum of 8GB RAM, 16GB recommended, with the minimum spec being clearly set out in the official documentation here: http://doc.freenas.org/index.php/Hardware_Recommendations
My post isn't a recommendation to run ZFS with less than the minimum recommended RAM, merely a recipe to explain how its possible should you so wish. There are undoubtedly some stability issues which some users will experience if they choose to implement this recipe, but at least performance should be acceptable for a small home LAN type scenario.
So here goes.
My Rig:
Step 1: Trade up to an Intel branded NIC. This single change fixed read performance by some 50MB/s without making any other config changes at all. Mine cost about £25 about 6 years ago, and all I had to do was rip it out of a rusting hulk in the attic, insert and reboot, then configure FreeNAS to route all data through the PCI NIC. PCI (not PCIe) supports Gigabit speed data transfer, particularly if you only have one PCI card in your machine. PCIe will clearly run a GigE NIC, but this might be overkill if you’re low on slots.
Modern Z87 and Z77 mobos contain Intel chipped on-board NICs, and i’m sure lots of older ones do too, so this step may not be necessary in your case, but if you have such a modern mobo, it probably supports a lot of RAM, so upgrade that instead.
Step 2: Modify some auto-tune sysctl settings as follows:
Step 3: Add the following sysctl settings:
There’s some debate about this one, but my iostat output clearly indicated a write improvement of about 5MB/s after I set this sysctl.
Step 4: Add the following tunables (loader.conf) settings
This last one fixed write performance in line with the move to an intel NIC, i.e. i gained 50MB/s
Step 4.5: Don’t adjust any kmem_size tunables created by auto tune. These are core to how FreeBSD manages kernel memory, and adjusting them will likely make your system unstable.
Step 5: Reboot - you need to reboot to make any tunable ‘take’, however sysctls will set themselves immediately after clicking OK.
Step 6: Do some performance testing - its important to measure what performance improvement you've achieved so that you feel validated in sticking with FreeNAS 9.2. The best way to do this is to open up the Shell and run the command below whilst copying some files to and from your FreeNAS box from a decently specced PC.
My zpool is named PrimaryData, you need to change value this to whatever you’ve named your pool.
Footnote:
My hard drive arrangement is I admit a bit odd, and definitely not recommended. It arose out of a few HDD failures which I decided to replace with larger drives. Over time, i'll replace the older 1TB drives with matched 2TB HDDs, and end up with more available disk space and hopefully better performance overall. The beauty of ZFS is that re-silvering is a doddle.
I thought I should share my experience in the hope that it will help others to live a faster life with an under-specced rig and reap all the benefits of the latest build of ZFS with out forking out a lot of cash.
Before my settings were implemented, I was getting only 11- 15MB/s read and write performance from my rig over GigE with just the standard autotune sysctls and tunables set. After applying the settings below, I saw reliable 65 - 70MB/s throughput and rock steady stability.
Firstly let me affirm the oft quoted statement that FreeNAS 9.2 needs a minimum of 8GB RAM, 16GB recommended, with the minimum spec being clearly set out in the official documentation here: http://doc.freenas.org/index.php/Hardware_Recommendations
My post isn't a recommendation to run ZFS with less than the minimum recommended RAM, merely a recipe to explain how its possible should you so wish. There are undoubtedly some stability issues which some users will experience if they choose to implement this recipe, but at least performance should be acceptable for a small home LAN type scenario.
So here goes.
My Rig:
- Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
- Gigabyte Mobo supporting max 4GB DDR3 RAM & Broadcom chipped Gigabit Ethernet on-board
- 4074MB RAM
- Super cheap Intel PCI GigE NIC
- 2 x 2TB + 2 x 1TB HDD drives in a single RAIDZ1 vdev
Step 1: Trade up to an Intel branded NIC. This single change fixed read performance by some 50MB/s without making any other config changes at all. Mine cost about £25 about 6 years ago, and all I had to do was rip it out of a rusting hulk in the attic, insert and reboot, then configure FreeNAS to route all data through the PCI NIC. PCI (not PCIe) supports Gigabit speed data transfer, particularly if you only have one PCI card in your machine. PCIe will clearly run a GigE NIC, but this might be overkill if you’re low on slots.
Modern Z87 and Z77 mobos contain Intel chipped on-board NICs, and i’m sure lots of older ones do too, so this step may not be necessary in your case, but if you have such a modern mobo, it probably supports a lot of RAM, so upgrade that instead.
Step 2: Modify some auto-tune sysctl settings as follows:
Code:
kern.ipc.maxsockbuf = 4194304
Code:
net.inet.tcp.recvbuf_max = 16777216 net.inet.tcp.sendbuf_max = 16777216
Step 3: Add the following sysctl settings:
Code:
net.inet.tcp.delayed_ack = 1
There’s some debate about this one, but my iostat output clearly indicated a write improvement of about 5MB/s after I set this sysctl.
Step 4: Add the following tunables (loader.conf) settings
Code:
vfs.zfs.prefetch_disable = 0
Code:
vfs.zfs.txg.timeout = 5 vfs.zfs.zio.use_uma = 1 vfs.zfs.write_limit_override = 268435456
This last one fixed write performance in line with the move to an intel NIC, i.e. i gained 50MB/s
Step 4.5: Don’t adjust any kmem_size tunables created by auto tune. These are core to how FreeBSD manages kernel memory, and adjusting them will likely make your system unstable.
Step 5: Reboot - you need to reboot to make any tunable ‘take’, however sysctls will set themselves immediately after clicking OK.
Step 6: Do some performance testing - its important to measure what performance improvement you've achieved so that you feel validated in sticking with FreeNAS 9.2. The best way to do this is to open up the Shell and run the command below whilst copying some files to and from your FreeNAS box from a decently specced PC.
Code:
zpool iostat PrimaryData 1
My zpool is named PrimaryData, you need to change value this to whatever you’ve named your pool.
Footnote:
My hard drive arrangement is I admit a bit odd, and definitely not recommended. It arose out of a few HDD failures which I decided to replace with larger drives. Over time, i'll replace the older 1TB drives with matched 2TB HDDs, and end up with more available disk space and hopefully better performance overall. The beauty of ZFS is that re-silvering is a doddle.