====== ZFS ====== See also **[[computing:storage:zfs_cmds|ZFS - Basic Commands]]** See also **[[computing:storage:napp-it|napp-it]]** See also **[[computing:unix:oi|OpenIndiana]]** [[http://constantin.glez.de/blog/2011/02/frequently-asked-questions-about-flash-memory-ssds-and-zfs|ZFS and SSDs]] [[http://jrs-s.net/2015/02/06/zfs-you-should-use-mirror-vdevs-not-raidz/|Mirrored vs. Striped]] [[https://icesquare.com/wordpress/how-to-improve-zfs-performance/|ZFS Performance Tips]] [[https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/|ZFS Administration]] [[http://www.oracle.com/technetwork/articles/servers-storage-admin/sto-recommended-zfs-settings-1951715.html|Best Performance]] [[http://www.oracle.com/technetwork/server-storage/sun-unified-storage/documentation/bestprac-zfssa-vsphere5-1940129.pdf|Oracle ZFS with VMware ESXi 5.x Best Practices]] [[http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide|ZFS Best Practices]] [[http://www.nexenta.com/corp/zfs-education/176-zfs-for-dummies|ZFS for Dummies]] [[http://www.nex7.com/readme1st|Read Me First]] [[http://docs.oracle.com/cd/E19253-01/819-5461/index.html|Oracle Solaris ZFS Administration Guide]] [[http://serverfault.com/questions/355708/where-can-i-find-introductory-documentation-for-zfs|ZFS Support Links]] [[https://pthree.org/2013/12/10/zfs-administration-appendix-c-why-you-should-use-ecc-ram/|Why You Need ECC RAM]] [[http://info.nexenta.com/rs/nexenta/images/nexenta_hardware_supported_list.pdf|Nexenta Hardware Support List]] [[http://www.princeton.edu/~unix/Solaris/troubleshoot/zfs.html|Troubleshooting and Info]] [[http://lildude.co.uk/zfs-cheatsheet|Cheat Sheet]] ZFS is a new and high-performance filesystem devised by Sun Microsystems (now Oracle) for the Solaris unix operating system. It has been ported to FreeBSD as well. ===== Down-Side of ZFS ===== http://www.eall.com.br/blog/?p=2481 ===== ZFS Server Software ===== * FreeNAS * http://www.freenas.org/ * Nexenta * http://www.nexenta.com * http://www.nexentastor.org * OpenIndiana + Napp-it * http://www.napp-it.org * http://wiki.openindiana.org/oi/napp-it,+ready+to+use+NAS+SAN+storage+server+with+WEB-GUI ===== Choosing Array Configurations ===== **Why not RAIDZ (RAID5)?** http://serverfault.com/questions/381908/grow-shrink-a-zfs-raidz http://www.nex7.com/readme1st (scroll down to 'Pool Design Rules') http://researchblogs.cs.bham.ac.uk/specialist-computing/2012/05/configuring-the-storage-pools-building-an-openindiana-based-zfs-file-server-part-4/ http://www.nex7.com/node/9 http://forums.freenas.org/showthread.php?7775-Slideshow-explaining-VDev-zpool-ZIL-and-L2ARC-for-noobs! http://forums.freenas.org/showthread.php?158-What-number-of-drives-are-allowed-in-a-RAIDZ-config http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#RAIDZ_Configuration_Requirements_and_Recommendations ==== Optimal Configurations ==== http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide :!: **Always use mirrored VDEVs** for best performance, reasonable protection, best degraded performance and fastest recovery from a failed disk. :!: **Performance really depends on the number of spindles**. :!: **Only for VM storage and databases do you need or want to enable sync**. If you simply use ZFS without foreign filesystems on it (VMs), ZFS will never corrupt on a crash due Copy On Write. So for regular filer use, disable sync unless you want a maximal security for small files like on a mailserver. :!: **Always utilize an SLOG** for your ZIL to improve synchronous write performance. **Database applications, NFS environments, particularly for virtualization, as well as backups are known use cases with heavy synchronous writes.** === RAIDZ1 === You should have 3, 5, or 9 devices in each vdev === RAIDZ2 === You should have 4, 6, or 10 devices in each vdev === RAIDZ3 === You should have 5, 7, or 11 devices in each vdev ==== Choosing RAID Strategies ==== http://www.oracle.com/technetwork/articles/systems-hardware-architecture/raid-strategy-hi-capacity-drives-170907.pdf ===== Compression ===== :!: Always enable compression. * LZJB is the default compression algorithm * Choose "**compression=lzjb**" due to its lower overhead * gzip level 6 (default) saves more space and is still pretty fast * gzip level 9 saves even more space but uses more CPU * If you enable compression on a pool, it will also be enabled for datasets in that pool * You can specify compression settings per dataset (share) zfs set compression=on rpool zfs set compression=on rpool/ROOT ===== Networking ===== * NFS or iSCSI? * http://blog.scottlowe.org/2009/07/01/republished-dispelling-some-vmware-over-nfs-myths/ * * Jumbo Frames? ===== High Availability ===== http://www.nexentastor.org/boards/1/topics/972 ===== Deduplication ===== http://constantin.glez.de/blog/2011/07/zfs-dedupe-or-not-dedupe http://www.zfsbuild.com/2011/11/18/dedupe-be-careful/ ===== Advance Format Disks (4k Sector) ===== http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ===== Managing ZFS Swap and Dump Devices ===== :!: For large-memory systems, choose a larger boot drive because the swap and dump devices take up a lot of space by default. http://docs.oracle.com/cd/E19963-01/html/821-1448/ggrln.html http://docs.oracle.com/cd/E19963-01/html/821-1448/zfsboot-2.html ===== Scrub Your Zpools ===== https://github.com/justintime/zpool-scrub-cron/blob/master/zpool_scrub.sh :!: Scrubs are I/O intensive and can negatively impact performance. They should be scheduled for evenings or weekends to minimize the impact to users. * Napp-IT has an ''auto-service'' to facilitate scrub job scheduling and creation ===== Snapshots and Clones ===== https://www.howtoforge.com/tutorial/how-to-use-snapshots-clones-and-replication-in-zfs-on-linux/ A **snapshot** provides a read-only, point-in-time copy of a file system or volume that does not consume extra space in the ZFS pool. The snapshot only uses space when the block references are changed. Snapshots preserve disk space by recording only the differences between the current dataset and a previous version. :!: A typical example use for a snapshot is to have a quick way of backing up the current state of the file system when a risky action like a software installation or a system upgrade is performed. A **clone** is a writable volume or file system whose initial contents are the same as the dataset from which it was created.