Oko
Contributor
- Joined
- Nov 30, 2013
- Messages
- 132
I am getting ready to build another FreeNAS box and I would like to have some clarification with respect to use of SSD drives for OS. Namely my original intent is to have to embedded SSDs on which FreeNAS 9.3 will be installed on ZFS partition and mirrored. However as we all know SSD are not as great as PR departments would like us to believe. Just to name a few serious issues.
At the end I just want to make clear that I am planning to use regular industrial grade HDD for storage pool. As all of above is related to the installation of FreeNAS itself (particularly FreeNAS 9.3 which supports root on ZFS) and best recommended practices when it comes to SSDs.
- Flash chip storage blocks can only be [re-]written a finite number of times.
- In order to deal with this and still have a usable product, SSDs use a fancy function in the controller called "wear leveling" which means that it keeps track of how many times the blocks have been written. My understanding is that as you [re-]written the performance exponentially decays.
- Some drives also have spare blocks because one of the ways to kill SSD drive is to completely fill it.
- There is a SSD function called "trim" with recent FreeBSD support. With a regular file deletion, all that the drive will be told is to clear some information from the directory and allocation bitmap (or equivalent metadata, depending on the filesystem in use). This means that the SSD will eventually "fill up" all of its storage blocks (due to the aforementioned wear leveling) and when it needs to write new data, it must first erase some storage blocks. That takes time, and it would be better to do in the background when the SSD isn't being heavily used.
- ZFS uses a logging mechanism, the ZFS intent log (ZIL) to store synchronous writes, until they're safely written to the main data structure on the pool. The speed at which data can be written to the ZIL determines the speed at which synchronous write requests can be serviced: The faster the ZIL, the faster most database, NFS and other important write operations become. Normally, the ZIL is part of the regular pool on disk. But ZFS offers the possibility to use a dedicated device for the ZIL. This is then called a "log device".
By using a fast SSD as a ZFS log device, you accelerate the ZIL and synchronous write performance improves. Adding SSD as a ZIL seems no brainier.
- ZFS also has a sophisticated cache called the "Adaptive Replacement Cache" (ARC) where it stores both most frequently used blocks of data and most recently used ones. The ARC is stored in RAM, so each block of data that is found in the RAM can be delivered quickly to the application, instead of having to fetch it again from disk. When RAM is full, data needs to be thrown out of the cache and is not available any more to accelerate reads. SSDs can be used as a second level cache: Blocks that can't be stored in the RAM-based ARC can then be stored on SSDs and in case they're needed, they can still be delivered quicker to the application than by fetching them again from disk. An SSD that is used as a second level ARC is therefore called an L2ARC, or a "cache device".
L2ARC is less interesting to me personally because I like to put lots of RAM.
At the end I just want to make clear that I am planning to use regular industrial grade HDD for storage pool. As all of above is related to the installation of FreeNAS itself (particularly FreeNAS 9.3 which supports root on ZFS) and best recommended practices when it comes to SSDs.
Last edited: