Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] {OT?} which fs on 1.8TB partition
Date: Sat, 07 Oct 2017 11:06:32
Message-Id: CAGfcS_k0ZTHKHR+zdoAm=Z0D=CPP21+2HAiBm60MPK--Djgzbw@mail.gmail.com
In Reply to: Re: [gentoo-user] {OT?} which fs on 1.8TB partition by Neil Bothwick
1 On Sat, Oct 7, 2017 at 6:28 AM, Neil Bothwick <neil@××××××××××.uk> wrote:
2 > On Sat, 7 Oct 2017 05:18:33 -0400, Tanstaafl wrote:
3 >
4 >> Anyone have any experience with comparing performance with either btrfs
5 >> or ZFS against either ReiserFS or XFS for a maildir based mail server?
6 >
7 > I tried btrfs on a mail server and it was unbearably slow. Disabling
8 > copy-on-write made a big difference, but it still went a lot faster when
9 > I switched to ext4.
10 >
11 > I haven't used XFS in years, maybe it's time to revisit it.
12 >
13
14 I haven't used xfs in a while, but here is my sense of things, for a
15 basic configuration (filesystem running on one drive or a mirrored
16 pair):
17
18 xfs > ext4 > zfs >>> btrfs
19
20 At least, that is in terms of most conventional measures of
21 performance (reading and writing files on a typical filesystem). If
22 you want to measure performance in terms of how long your system is
23 down after a controller error then both zfs and btrfs will have an
24 advantage. I mention it because I think that integrity shouldn't take
25 a back seat to performance 99% of the time. It has performance
26 benefits of its own, but you only see them every couple of years when
27 something fails.
28
29 btrfs isn't horrible, but it basically hasn't been optimized at all.
30 The developers are mainly focused on getting it to not destroy your
31 data, with mixed success. An obvious example of this is that if you
32 read a file from a pair of mirrors, the filesystem decides which drive
33 in the pair to use based on whether the PID doing the read is even or
34 odd.
35
36 Fundamentally I haven't seen any arguments as to why btrfs should be
37 any worse than zfs. It just hasn't been implemented completely. But,
38 if you want a filesystem today and not in 10 years you need to take
39 that into account.
40
41 Now, ZFS has a bunch of tricks available to improve things like SSD
42 read caches and write logs. But, you could argue that other
43 filesystems support separate journal devices and there is bcache so I
44 think if you want to look at those features you need to compare apples
45 to apples. ZFS certainly integrates it all nicely, but then it has
46 other "features" like not being able to remove a drive from a storage
47 pool, or revert to a snapshot without deleting all the subsequent
48 snapshots.
49
50 In general though I think zfs will always suffer a bit in performance
51 because it is copy-on-write. If you want to change 1 block in the
52 middle of a file, ext4 and xfs can just write over that 1 block, while
53 zfs and btrfs are going to write that block someplace else and do a
54 metadata dance to map it over the original block. I just don't see
55 how that will ever be faster. Of course, if you have a hardware
56 failure in the middle of an operation zfs and btrfs basically
57 guarantee that the writes behave as if they were atomic, while you
58 only get that benefit with ext4/xfs if you do full journaling with a
59 significant performance hit, and if you're using mdadm underneath then
60 you lose that guarantee. Both zfs and btrfs avoid the raid write hole
61 (though to be fair you don't want to go anywhere near parity raid on
62 btrfs anytime soon).
63
64 I'm not saying that there isn't a place for performance-above-all.
65 For an ephemeral worker node you already have 47 backups running and
66 if the node fails you restart it, so if it needs to write some data to
67 disk performance is probably the only concern. Ditto for any data
68 that has no long-term value/etc. However, for most general-purpose
69 filesystems I think integrity should be the #1 concern, because you
70 won't notice that 20us access time difference but you probably will
71 notice hour spent restoring from backups, assuming you even have
72 backups.
73
74 --
75 Rich

Replies

Subject Author
Re: [gentoo-user] {OT?} which fs on 1.8TB partition Neil Bothwick <neil@××××××××××.uk>