ext4 File System: Introduction and Benchmarks

Destined to become the default file system for the more popular Linux distributions, ext4 is out of experimental mode and gearing up for production environments. Here's what you need to know.

Benchmarking ext3 and ext4

I’m using several benchmarks for testing ext3 and ext4 (benchmarking file systems is a pet peeve of mine, but I digress). For now, I will be testing just iozone since it seems to be a popular benchmark that can produce a great deal of information.

I ran two sets of tests on ext3 and ext4. The first test builds the file systems with the defaults. The second test takes some of Ted Ts’o's advice and changes the mount options. Iozone produces a great deal of information but I chose to just show the results for read, reread, write, and rewrite for a 2GB file with a record length of 16,384 bytes. This shows the performance for a very large file (perhaps a KC and the Sunshine Band album in ogg format).

The results have 4 columns: Ext3 (default), Ext4 (default), Ext3 (performance), and Ext4 (performance). The “performance” options are not intended to produce the optimal performance but to illustrate what kind of performance you could obtain with some fairly easy changes. The commands to make the four files systems are:

% mke2fs -t ext3 /dev/sda1
% mke2fs -t ext4 /dev/sdb1
% mke2fs -t ext3 /dev/sda1
% mke2fs -t ext4 /dev/sdb1

The difference for the “performance” options are the mount options. For ext3, the entry in /etc/fstab is,

/dev/sda1  /data_ext3   ext3    defaults,data=writeback,noatime   0 0

For ext4, the mount options are:

/dev/sdb1  /data_ext4   ext4    defaults,data=writeback,noatime,barrier=0,extents,journal_checksum    0 0

The mount options used both the “noatime” and the “data=writeback” options. Whether these options are acceptable or not is up to you. By default ext3 does not use barriers (for good or bad). Ext4 uses barriers by default. So to make things equal I disabled barriers on ext4.

Benchmark Ext3 (default)
MB/s
Ext4 (default)
MB/s
Ext3 (performance)
MB/s
Ext4 (performance)
MB/s
Write 28.307 30.228 28.047 30.127
Rewrite 28.001 29.626 26.432 29.336
Read 55.791 108.701 105.565 109.889
Reread 55.765 108.884 105.156 109.600

One of the more interesting things you can take from the results is that the defaults for ext4 produce the top (or near the top) results for write, rewrite, read, and reread. Once all of the mount options are used with ext3, it achieved about the same performance of ext4 with or without the mount options.

The benchmarks may or may not be applicable to your situation but I do think they point out that the ext4 defaults produce very good performance relative to ext3. Performance being one of the goals in the development of ext4, I think the dev team hit the mark.

Summary

Ext3 is arguably the most popular file system in Linux. It has good enough performance and is very stable. But there have been a number of complaints about it, primarily in the areas of performance and overall capacity. Ext4 was really a fork of ext3 to add features. It was merged into the mainstream kernel a while ago but was marked as experimental. More recently, it was merged into the kernel to get more testing. Now, with the experimental label removed, ext4 has arrived and is ready for prime time.

For more info check out our interview with Ted Ts’o's, which points out that ext4 has some fantastic features and provides links to some great blogs about ext4 — particularly using ext4 on SSDs (Solid State Disks).

Should you move immediately to ext4? While you can migrate an ext3 file system to ext4, it requires a kernel capable of supporting ext4 (2.6.28 or newer or a kernel that has ext4 back-ported to it) and a relative new version of e2fsprogs. The quick benchmark I presented shows that ext4 has great performance using the defaults.

So while an immediate leap to ext4 may not be necessary, if you are currently using ext3 you should seriously start considering it for your default file system in the future.

Jeff Layton is an Enterprise Technologist for HPC at Dell. He can be found lounging around at a nearby Frys enjoying the coffee and waiting for sales (but never during working hours).

Comments on "ext4 File System: Introduction and Benchmarks"

cwtryon

Thanks for the introduction! While I realize that file systems can be an even more hotly debated religious topic than KDE vs. Gnome, do you have any indications on how ext4 performs compared to some of the other “new” file systems, such as JFS? One of the other big problems with ext3 has been handling massive numbers of really small files in a single directory. I actually worked a job where we were worried that a 2TB partition was “too small” for the amount of data we had to store, but we were stuck with older versions of RH EL, and not sure where to go. This may be the new way forward, as file system requirements continue to explode.

Reply
laytonjb

cwtryon,

I agree with your thoughts about ext3 and ext4. In the past ext3 has felt kind of limiting and with RHEL that was the primary file system of choice. I’ve never tried to use JFS or Reiser on RHEL. Typically what I do is install RHEL using ext3 for / (I use ext2 for /boot), and once I’m happy, I build a new kernel with XFS and JFS enabled. I install all of the support tools and then build a new file system using XFS or JFS on other drives. This works well enough for me :)

I don’t know about performance of JFS vs. ext3 or ext4. One of my goals is to do some extensive benchmarking to get a feel for the relative performance differences. Drop a note to the editor about a file system benchmarking article and maybe he’ll ask me to do one :)

BTW – I’m working on a similar article for btrfs. While it’s still experimental I want to get a feel for it as well. Ted Ts’o think the combination of ext4 and btrfs is the future and I couldn’t agree more. There are some other up and coming file systems that show some promise as well.

Also – thansk for the compliment! Glad it helped.

Jeff

Reply
ndatta

This is a great article and a very good introduction to ext4. Thanks!

Reply
rkoski

Actually, the ext3 file system size limit is only 8 TB. Tried to make 9 TB ext3, but the only block size option was 4 KB, which resulted in said max 8 TB file system. Used CentOS 5.2. Maybe there is some combination of kernel, e2fsprogs, etc. which can use 8 KB blocks, perhaps kernel 2.4.x ;)

Reply
dbindner

There’s always something to complain about with benchmarks, so naturally I have a complaint. Given that this was a very introductory article, I think it would have made sense to test the two filesystems in the configurations that are most common, i.e. their default configurations.

When more technical articles follow, you can delve into the options that a careful sysadmin would tune. But most people (and many admins) are going to use the default settings and will want to know about performance as well as reliability. It may be a bit hard to say about reliability for the moment, but at least that “typical” performance can be measured.

Reply
graemeharrison

Great article… but I too have an issue about the benchmarking needing to compare ‘out of the box’ default configurations. You disabled “barriers” which are by-default ON with Ext4 (for cited reason of compatibility) but really, if Ext4 will have data-security features, at least one column in results should have been the default use of Ext4.

Reply
sdean7855

Great article. Jeff, since you are an Enterprise Technologist for Dell, I have a question about the inter-relation/robustness/capability of ext4 and btrfs and PC hardware…or Dell server hardware. Ts’o wrote a telling piece back in ’04, entitled ‘reiserfs’ but it might as well have been entitled crappy PC hardware. It was his take back then that SGI and Sun had built their hardware to deal somewhat gracefully and sequentially with a power cord yank but that crappy PC hardware died a thrashing chaotic death that would write crap…even upon the metadata. Have things improved, at least with Dell Poweredge server hardware? Does ext4 and btrfs do physical journalling?

Reply
gigo6000

Nice article , just yesterday while installing ubuntu 9.04 I noticed this new filesystem and didn’t know if it was ok to use it since ext3 works fine for my needs.

Reply
rosbif

Thank you for a nice article.

One little nit-pick:
The maximum file size for ext2 is much greater than the 2GB stated.
It depends on the block size but seems to be 2TiB with a 4KiB block size.

Of course it is true that some 32-bit applications may be limited to a 2GiB maximum file size but this is a limitation of the application and not of the file system.

Reply

Leave a Reply to dbindner Cancel reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>