Re: XFS vs Ext4 redux -- preferences/warnings/etc
Date: Thu, 11 Apr 2019 17:20:45 -0400
Message-ID: <654461da-d583-88d2-1ab3-8b7cbb8ef259_at_gmail.com>
Hi Rich!
I have recently purchased a new desktop which I use as a virtualization server. The server has 2 SSD devices:
disks
root_at_umajor:~# grep -i ext4 /etc/fstab
UUID=21b7fcff-853c-4d1c-a79b-15e44f18d6d9 / ext4
errors=remount-ro 0 1
/dev/sda1 /fast1 ext4 noatime,data=writeback 0 0
UUID="21ced85c-f965-4475-8235-4075fced0342" /backup ext4
noatime,commit=90 0 0
The last disk, mounted on /backup, is an external USB device, not relevant for this story. The mount point name describes its function well. I have no problems with the speed and my foremost concern is about the speed of read. Ext4 is much newer than XFS, which is more than 2 decades old. It stands to reason that there is much more active development on Ext4 than on XFS or JFS, both supported on Linux. It is reasonable to expect better performance for mostly read-only loads, like the loads caused by running virtual machines, will be better on Ext4. I also have a classic rotational disk for the things like software distributions, documents and alike:
root_at_umajor:~# grep xfs /etc/fstab
/dev/sdd2 /misc xfs noatime 0 0
/dev/sdd3 /dist xfs noatime 0 0
root_at_umajor:~#
So, that was my reasoning. If I were looking to run databases directly on my desktop, I would have probably opted for XFS. For now, I have 21 virtual machines there and no performance problems.
Now, there is one small thing about the journals that you should know: only the inode operations are logged, not the data block operations. What is journaled is file creation/deletion, space extension or reduction and operations like mv, chmod or chown. The operations on the data blocks are NOT logged, as that would impose too severe performance penalty. Journaling file systems are protecting you from the file loss, as suffered in the time of fsck. They do not protect you from the data loss. Last, but not least, you should also tell your system that your disk is not rotational:
echo 0 > /sys/block/sda/queue/rotational
That will make your Linux aware of what kind of disk it has to deal with. So, as you can see, there is a lot of philosophy behind the choice of file system and tuning the system.
Regards
Both SSD disks are formatted as Ext4 file systems and no, the journal is not turned off. The moung
On 4/11/19 10:08 AM, Rich J wrote:
>
> On 2019/04/11 06:24, Mladen Gogala wrote:
>
>> On 4/11/19 5:56 AM, Stefan Koehler wrote:
>>> Hello Rich,
>>> one clear recommendation: Go with XFS.
>>
>> Well, it's not that simple. For SSD's, Ext4 is far better option. XFS
>> is a classic extent based file system which is essentially the same
>> since the glory days of SGI. Here are two good articles:
>>
>> https://www.maketecheasier.com/best-linux-filesystem-for-ssd/
>>
>> https://www.addictivetips.com/ubuntu-linux-tips/best-ssd-friendly-file-systems-on-linux/
>>
>> The best answer we can give is the famous "it depends". This time it
>> depends on the user's hardware.
> Interesting articles, but their focus is clearly not on data
> protection (or servers). There is exactly a 0% chance I'd ever mount
> a Linux filesystem containing business data on my Production ERP boxes
> without a journal.
> I've found Kevin Clossen's experiment from 2012 that seems to conclude
> that EXT4 (at the time) serialized writes. I'd question the software
> RAID in his test, but XFS didn't have the throughput problem. But
> that was 7 years (and 1 major OEL release) ago.
> https://kevinclosson.net/2012/03/06/yes-file-systems-still-need-to-support-concurrent-writes-yet-another-look-at-xfs-versus-ext4/
> I've also found Andre Leibovici's recent SLOB tests using flash
> storage. Like just about everywhere else, the conclusion is that XFS
> outperforms EXT4 for Oracle database loads. However, the tests are
> done with an open converged system (Datrium), so I'm not sure how
> that'll translate to a traditional SAN.
> http://myvirtualcloud.net/ext4-vs-xfs-vs-asm-vs-asm-oel-which-one-performs-better-taking-it-to-the-next-level/
> So, yes, I've been leaning towards XFS. But since I haven't used it
> on a Production Oracle server of any size, and I got burned by XFS
> once (probably 15 years ago now?), I had to ask the question. Again. :)
> Thanks Mladen and Stefan,
> Rich
-- Mladen Gogala Database Consultant Tel: (347) 321-1217 -- http://www.freelists.org/webpage/oracle-lReceived on Thu Apr 11 2019 - 23:20:45 CEST