EXT3 vs EXT4 vs XFS vs BTRFS filesystem comparison on Fedora 18

Written by Gionatan Danti on . Posted in Linux & Unix

User Rating:  / 44
PoorBest 

MySQL performances

Benchmark profile:
Sysbench (InnoDB back-end):
- prepare: 100K inserted rows
- simple: 32 threads / 100K read-only selects
- complex: 32 threads / 10K read-write transactions
mysql-bench (MyISAM back-end): default settings

We can now turn our attention to the widespread MySQL database, using sysbench and mysql-bench. First, we prepare the database by inserting 100K rows into a newly created DB:

All filesystem are very quick to populate the database.

In simple (read only) workload, we can see no real differences.

Even the complex, read-write, transactional DB test results are quite similar between each other.

If sysbench used a InnoDB MySQL DB, with mysql-bench we use the read-oriented MyISAM as database engine:

Here BTRFS is significantly slower then EXT3 and EXT4. Even XFS is somewhat slower then the two EXT-based filesystems.

Comments   

 
#1 Jan 2013-06-27 15:42
Thanks for the test. It seems, as if btrfs is a bit Janus-faced: sometimes very fast, sometimes very slow.

It would be very interesting for future tests, how ZFS on Linux performs. Especially, after it has become "productive" some weeks ago.
 
 
#2 Gionatan Danti 2013-06-27 16:12
Hi Jan,
this is surely a good idea ;)

I will investigate this possibility for the next review.

Regards.
 
 
#3 Altr 2013-12-21 10:49
Thank you for the benchmarks!
 
 
#4 Iván Baldo 2014-04-14 03:12
For databases or virtual machine images, you should disable the copy-on-write semantics of BTRFS.
You don't need to set the entire filesystem to be non COW, only the directory and files that need it (chattr -C flag).
 
 
#5 Gionatan Danti 2014-04-14 09:39
Quoting Iván Baldo:
For databases or virtual machine images, you should disable the copy-on-write semantics of BTRFS.
You don't need to set the entire filesystem to be non COW, only the directory and files that need it (chattr -C flag).


Hi Ivan,
you are right. Anyway, I benchmarked BTRFS even with disabled CoW and found that, for virtual machines at least, it performs noticeably worse than a traditional filesystem as EXT4.

You can read more here:
http://www.ilsistemista.net/index.php/linux-a-unix/36-btrfs-mount-options-and-virtual-machines-an-in-depth-look.html

The only catch is that both tests are somewhat old now, being performed on Fedora 17 and 18. I should really see if with newer kernels BTRFS performances are better now.

But I have so little time ;)
 
 
#6 Dan 2015-10-09 06:37
It's two years later, but this post still comes up tops on a search and the conclusions is outdated. Critical data requires historical snapshots AND backups (preferably backups of the historical snapshots). Big critical data requires applications that are well written to do atomic transactions leaving the disk always consistent (assuming the fs supports it) and then requires atomic backups leaving the backups consistent. This simply is NOT achievable (ie impossible) with ext3 or ext4. Adding some small extra stability risks to the many risks that already exist is a small price to pay for proper protection from those risks. NTFS has had shadowcopies for ages by the way. Actually building a backup scheme to leverage these tools in a smart way isn't so simple, but it's worth doing.
 

You have no rights to post comments