EXT3 vs EXT4 vs XFS vs BTRFS linux filesystems benchmark

Written by Gionatan Danti on . Posted in Linux & Unix

User Rating:  / 129

Bonnie++: sequential I/O bandwidth

The bonnie++ suite enable us to do some very interesting measurements. The first graph show the sequential I/O bandwidth and CPU usage using a single character at a time:

Bonnie++ sequential char input output speed

As you can see, the absolute values are quite low (~1600 KB/sec max) but this is expected: hard disks are block devices and so they are very inefficient in this kind of test. Moreover, issuing only one character at a time the CPU is very busy. This means that this test actually measure the filesystem efficiency rather than raw I/O bandwidth. You can see that BTRFS is by large the worse here, as it can transfer only ~200 KB/sec with a CPU load of around 100%. In contrast, EXT3 and EXT4 are much faster in the input test but only slight better in the output test. XFS seems the best balanced here: its input speed is only a little behind EXT3/4 rate, while scoring 2X better in the output test.

However, hard disk are block devices: this means that the block I/O test is way more meaningful:

Bonnie++ sequential block input output speed

Here we can see that the absolute values are quite well matched, depending on hard disk performance other than filesystem structure. However, the CPU load data indicate that not all filesystems are equally efficient: XFS seems the best here, followed by EXT4, then EXT3 and finally by BTRFS. While the differences are not so big (we are speaking about some % points), they are interesting indeed.

Now, let's have a look at direct data transfer (eg: without any OS/FS caching scheme):

Bonnie++ direct sequential block input output speed

This graph seems to indicate that for application requiring direct access to filesystem, bypassing the OS/FS cache (eg: video recording, some virtual machine software, ecc.), EXT3/4 are the best choice, followed by BTRFS and, at last place, XFS.

This first round of tests prove that we don't have a silver bullet in this arena: we don't have an always-better filesystem. It all boil down to your usage pattern. However, it seems that BTRFS can be a little more problematic to profile.

But let's examine some other bonnie++ tests...

UPDATE: preparing the system for another benchmark, I noticed that, in contrast to what written in Fedora 14 documentation, write barriers were non enabled on EXT3 filesystem. Please read the updated "Conclusions" page.


#1 Max 2012-08-26 15:49
Thank you for this very interesting article. I'll go with ext3, mostly because of your verdict for it being a good and balanced filesystem.
#2 Gionatan Danti 2012-08-26 16:11
Hi Max,
I'm happy that you found my article interesting.

However please note that, as you can read in the updates, EXT3 was incorrectly benchmarked with write barrier off, while all other filesystems used barrier on.

This means that EXT3 data were somewhat flawed. For up-to-date data, please read my latest article here: http://www.ilsistemista.net/index.php/linux-a-unix/33-btrfs-vs-ext3-vs-ext4-vs-xfs-performance-on-fedora-17.html

#3 Kuba 2012-10-09 15:01
Hi Gionatan,

Could you please let me know what sysbench parameter you have used to perform these tests?

#4 http:// 2014-03-08 09:57
I believe what you published was very reasonable. But,
what about this? suppose you typed a catchier post
title? I mean, I don't want to tell you how to run your website, however suppose you added something to possibly get people's attention?
I mean EXT3 vs EXT4 vs XFS vs BTRFS linux filesystems benchmark is a little vanilla.

You ought to glance at Yahoo's home page and see how they write
article headlines to get people to open the links.

You might add a video or a pic or two to get readers excited about everything've got to say.
Just my opinion, it could bring your website a little bit more interesting.

You have no rights to post comments