First benchmarks of the ext4 file system
Seeing that the development of the ext3 file system successor has started, and that Andrew Morton has released mm patch containing ext4 file system, I decided to run some simple benchmarks, even in this early stage of development.
Because the mm patch also contains Hans Reiser's reiser4 file system, I decided to run benchmarks against it, too, for a good measure. Let me once again remind that both ext4 and reiser4 are still in development, while ext3 has been in production for many years, so take all the results below with a grain of salt.
All tests were run on a modern Intel E6600 based desktop equipped with an ATA disk. I made a small partition exclusively for this testing. File system under testing was recreated and freshly mounted for each and every test below, so that caching doesn't get in out way (I could've also used drop_caches kernel mechanism to get rid of caches, but this is safer). This also means that all tests were done in pristine environment, not accounting for fragmentation and other effects happening in real environments. ext4 was mounted with
mount /dev/hda2 /mnt -t ext4dev -o extents so that extents are enabled. The kernel used was 2.6.19-rc2-mm1. The I/O scheduler was the kernel default CFQ.
I used an aging bonnie application to make some quick measurements of file system performance when doing sequential I/O operation.
Not much surprises here. While there are some differences among the file systems, I don't think they're that much interesting. All file systems are able to read sequentially from big files with speeds close to the platter speed (57MB/s in this case).
Sequential writing, on the other hand, shows that there are some real improvements built into ext4. Probably extents together with delayed block allocation allow ext4 to come first in this benchmark, leaving the other two file systems good 20 percent behind.
Creating/deleting small files
The other typical operation file systems do in some workloads is managing many small files. To measure performance in such environment I decided to prepare a simple application (make-many-files) whose only task is to make many small files (405,000 in this case), but also distribute them in a tree like structure, so that we don't measure directory operations only (it's a known fact that the performance of file system drops rapidly when you go over some number of files in the same directory). You can find the source of the applicaton attached to this article, if you would like to run it yourself.
While it can be seen that ext4 shows a slight regression over ext3, the real winner here is reiser4. It seems that ext4 could use some improvements in this area (rapid file creation).
Deleting almost half a million files created in the previous step is a completely different picture. Here ext3/4 completely dominate reiser4. Once again ext4 is slightly slower, but not much.
I also need to mention that for the above two tests reiser4 took much more CPU cycles. I'm not putting the graph here because it would not be easy to interpret, but it seems that the other testers were on the right track saying that reiser4 is quite heavy on CPU under some loads.
For the final test, I decided to go with a macro benchmark. I ran postmark, a benchmark that's based around small file operations similar to those used on large mail servers and news servers. I used the following configuration for testing:
set read 4096
set write 4096
set transactions 10000
set size 500 500000
set number 5000
What we get out, after a few minutes of crunching with postmark, is the number of transactions per seconds. Where the bigger number indicates more performant file system. Ext4 has improved over ext3, but once again reiser4 is leading the bunch.
The ext4 file system promises improved data integrity and performance, together with less limitations, and is definitely the step in the right way. Even if there are some regressions in our measurements, when compared to ext3, they're quite small and no doubt will be fixed before the development is finished. On the other hand, under some workloads ext4 is already showing much better results.
Another surprise of this test is reiser4, which has the best performance in some tests.
It should be also noted that all the file systems were completely stable during these testing, no crashes, no unexpected behaviour. So feel free to do your own tests, but still be very careful before entrusting your important data to them (except ext3, of course).