There is a newer version of this build. Check it out!
FreeNAS Performance
NAS performance is often tricky to measure because everything is relative to the size of the file you are transferring and the caching technique used to facilitate the transfer. In my previous post about using the TonidoPlug as an alternative to Droboshare, I’ve discovered that these underpowered devices lacked sufficient amount of memory to cache large files. Therefore, the burst speed (transferring small files, say 5mb) is a lot faster than the sustained speed (transferring large files, say 2GB). The Droboshare gives 6mb/s of sustained speed when transferring anything over 300MBytes, read up on a quick review from Engadget.
After testing my FreeNAS rig, I copied a 4GB file via Gigabit Ethernet and the throughput sustained at 25MBytes/s, which is 4 times the speed of the Drobo + Droboshare! That’s not bad at all!
Reading speed is 35MBytes/s, not great but good enough. The bottleneck here seems to be the Intel NM10 chipset bundled with the new Atom chip. I have seen people with regular desktop chipsets that can do 70-80MBytes/s read and 30-40MBytes /s write.
System Tweaks
The out of the box performance wasn’t exactly topnotch, but it’s nothing that can’t be fixed without a little tweaking. Since we use ZFS and Samba, let’s dig into the details on these two beasts.
ZFS
First, make sure you are running the latest nightly build FreeNAS that has the latest vesrion of ZFS – version 13.
Secondly, ZFS is a very memory intensive file system, largely due to the caching. The more caching done, the faster the speeds.
To change the cache size, login to the FreeNAS web GUI, Advanced->File Editor and load /cf/boot/loader.conf (if you are using the embedded FreeNAS version). Otherwise, load /boot/loader.conf
Copy and paste the following code and save the file.
kern.hz="1000" vm.kmem_size="1524M" vfs.zfs.arc_min="256M" vfs.zfs.arc_max="768M" vfs.zfs.txg.timeout="10" vfs.zfs.vdev.max_pending="10" vfs.zfs.vdev.min_pending="4"
This tweak is best for systems with 2GB of RAM. The vm.kmem_size defines the total amount of RAM the kernel can allocate for ZFS. It should be set to about 50%-70% of your total RAM size. The vfs.zfs.arc_max size should be about half of vm.kmem_size.
Samba
The folks over at FreeNAS have done a great job of keeping Samba up to date, especially with the latest nightly builds. Most of these experimental builds have been rock solid.
The secret to having a speedy Samba server is to enable Asynchronous IO. This feature has been built into the latest nightly build starting from FreeNAS 0.7.2 (5191).
Simply go to your Samba configuration page in the web GUI, and enable AIO and use the default value of “1″ for both AIO Read and Write size.
Also do not forget to enable the “Large Read/Write” feature for Samba, and enable keneral tuning. (Go to System->Advanced – enable Tuning)
That’s it, after a reboot you are done. Most of the optimizations have been enabled by FreeNAS out of the box, but there are some experimental features that you have to dig out on your own. You should test the ZFS RAM size and its impact on performance. Also be aware that the memory size allocated cannot be too large, or your system may become unstable.
That’s it guys, this concludes my NAS build. I apologize for the long wait, but the end result is very satisfying.
It is possible to build your own NAS with Drobo abilities for half of the price and 5 times the speed. =p
Please leave comments and questions.
Pingback: Review – HP Microserver « Chris Swan's Weblog