From owner-freebsd-questions@freebsd.org Thu Dec 15 15:05:36 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9CFAC7722E for ; Thu, 15 Dec 2016 15:05:36 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A4A80B22 for ; Thu, 15 Dec 2016 15:05:35 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from host-4-75.office.adestra.com (unknown [85.199.232.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id BCFFF798D for ; Thu, 15 Dec 2016 15:05:22 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/BCFFF798D; dkim=none; dkim-atps=neutral Subject: Re: gmirror/gstripe or ZFS? To: freebsd-questions@freebsd.org References: <20161215111048.541d6745@Papi> From: Matthew Seaman Message-ID: <8129aba8-acdc-c921-62ce-ed0f994cf2af@FreeBSD.org> Date: Thu, 15 Dec 2016 15:05:12 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161215111048.541d6745@Papi> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Fe0wjaGJpSkXTs5JvUQ3NUjH26veEO6Te" X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,RCVD_IN_RP_RNBL, RDNS_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2016 15:05:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Fe0wjaGJpSkXTs5JvUQ3NUjH26veEO6Te Content-Type: multipart/mixed; boundary="tEBdl9arB5MUs0oflXxUFmrVlrNNHLbjw"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: <8129aba8-acdc-c921-62ce-ed0f994cf2af@FreeBSD.org> Subject: Re: gmirror/gstripe or ZFS? References: <20161215111048.541d6745@Papi> In-Reply-To: <20161215111048.541d6745@Papi> --tEBdl9arB5MUs0oflXxUFmrVlrNNHLbjw Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016/12/15 14:10, Mario Lobo wrote: > I'll be building an area on an existing server that runs 10.3-STABLE > (will upgrade to 11-STABLE), which is going to be used basically as a > work/storage area for graphic design files (lots and lots of image > editing, etc ...) that are extremely critical for the company and need > to be up and ready all the time. >=20 > A backup system is already in place and running. >=20 > The OS runs off of its own ufs formatted drive and I acquired 4x 4Tb > drives (sata), which I plan to gmirror 1&2/3&4, stripe the two mirrors > into an 8Tb volume, and share it via samba. Network is Gbit. >=20 > It comes to mind doing the same thing through ZFS. I've never used it > before, which is the opposite of gmirror/gstripe, which I have used > plenty. >=20 > Given what this volume is going to be used for, in terms of > performance/reliability/sharing, which one is best? >=20 > I have replaced defective drives in gmirror many times without any > problem. Is that just as easy with ZFS? >=20 > Is sharing a dataset through samba as straight forward as sharing a > gmirror/gstripe? >=20 > I am reading as much as I can about ZFS but most of what I found is > mainly technical implementation, not so much about how the user is > experiencing it compared to other options. If your data is at all important to you and you aren't constrained by running on tiny little devices with very limited system resources, then it's a no-brainer: use ZFS. Creating a ZFS striped over two mirrored vdevs is not particularly difficult and gives a result about equivalent to RAID10: zpool create tank -m /somewhere mirror ada0p3 ada1p3 mirror ada2p3 ada3= p3 will create a new zpool called 'tank' and mount it at /somewhere. There's a number of properties to fiddle with for tuning purposes, and you'll want to create a heirarchy of ZFSes under zroot to suit your purposes, but otherwise that's about it. Replacing drives in a ZFS is about as hard as replacing them in a gmirror / gstripe setup. Swap out the physical device, create an appropriate partitioning scheme on the new disk if needed[*], then run 'zpool replace device-name' and wait for the pool to resilver. There are only two commands you need to achieve some familiarity with in order to manage a ZFS setup -- zfs(8) and zpool(8). Don't be put off by the length of the man pages: generally it's pretty obvious what subcommand you need and you can just jump to that point in the manual to find your answers. [*] The installer will create a zpool by using gpart partitions, so it can also add bootcode and a swap area to each disk. If you're not going to be booting off this pool and you have swap supplied elsewhere, then all that is unnecessary. You can just tell ZFS to use the raw disk device= s. Problems you may run into: * Not having enough RAM -- ZFS eats RAM like there's no tomorrow. That's because of the agressive caching it employs: many IO requests will be served out of RAM rather than having to go all the way to disk. Sprinkling RAM liberally into your server will help performance. * Do turn on compression, and use the lz4 algorithm. Compression is a win in general due to reducing the size of IO requests, which gains more than you lose in the extra work to compress and decompress the data. lz4 is preferred because it gives pretty good compression for compressible data, but can detect and bale out early for incompressible data, like many image formats (JPG, PNG, GIF) -- in which case the data is simply stored without compression at the ZFS level. * Don't enable deduplication. It sounds really attractive, but for almost all cases it leads to vastly increased memory requirements, performance slowing to a near crawl, wailing, and gnashing of teeth. If you have to ask, then you *don't* want it. * ZFS does a lot more processing than most filesystems -- calculating all of those checksums, and doing all those copy-on-writes takes its toll. It's the price you pay for being confident your data is uncorrupted, but it does mean ZFS is harder on the system than many other FSes. For a modern server, the extra processing cost is generally not a problem, and swallowed in the time it takes to access the spinning rust. It will hurt you if your IO characteristics are a lot of small reads / writes randomly scattered around your storage, typical of eg. a RDBMS. * You can add a 'SLOG' (Separate LOG) device to improve performance -- this is typically a fast SSD. Doesn't have to be particularly big: all it does is move some particularly hot IO caches off the main drives onto the faster hardware. Can be used for ARC (reading data) or ZIL (writing data) or both. However, you can add this on the fly without any interruption of service, so I'd recommend starting without and only adding one if it seems you need it. * Having both UFS and ZFS on the same machine. This is not insurmountably bad, but the different memory requirements of the two filesystems can lead to performance trouble. It depends on what your server load levels are like. If it's lightly loaded, then no problem. Cheers, Matthew --tEBdl9arB5MUs0oflXxUFmrVlrNNHLbjw-- --Fe0wjaGJpSkXTs5JvUQ3NUjH26veEO6Te Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJYUrEuXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnZyQP/0VHLpdJNvdmDb1A9QcefOeJ ho3p1YWiDr3czH9rMu5K+186e+28md4glzDH0SvcxDUefOIx4xwaD/ybBXlYeHoZ i8RXLuByk3Lrn7tIv+M/jHJ93r+JP7V7dcjiAoUEW3hAo3WEsDBQ1t6XgPbFKBz0 yTxZtoiEos8VXNuAUI1DNU2+USCIrNLquh2rOLeFRdDZ4eYcYwjWDpoFH/XN7Zty jyBeMMqwNWwRDnBOe9/65L9VnMxGF+4Rfe3T+Y9h9kRDA94Scy2MdsFZY8ZmfrJU UI50xQJt4X+A1+pWcdrfrix0Cm59oupMHne2pMs8Koypt5wC+v9Kn0bsn0RWOA66 V8zYbTB+RHvr4ARkEW28GTEgp88drjlwtpZFx1nScGvCjSpYl8q3G3mkxVIK9uIa K0zhlo8Y0FVSOi6kE6pAfMx+E9gNx0E7/yIMnZJDPXNnAJLk6YCwAxRty6eUgmiY jwmZXYXjwWjoIg0WEuCopDht49NwrnuRozIk5b2w5Y7fpI1eSIR565MMGfzBt/dd C0rDFDfexcSQZ0uPnF5QA1k24qD5mCn3mZLDU3Zs1tQznUOt44bJ3TDBelV8YYED /kxatMe8NEoX7SmWurY3pN0sqAliJJ01wkqL8TBIGXyuaxRMsrCrKpB0lx9ASu4B KJd7EFYP97Fgb4JKdqWi =hFsZ -----END PGP SIGNATURE----- --Fe0wjaGJpSkXTs5JvUQ3NUjH26veEO6Te--