Fragmentation: Sysbench write tests
The previous test shows very good results, but you should not make the mistake to think that Linux is invulnerable to fragmentation: previous case was quite simple from a fragmentation standpoint, as the extracted files were quite small and were sequentially created.
But how these filesystems behave with a more complex sequential test? Let's see the sysbench sequential write test, that create 16 files, each 64 MB long (for 1 GB total data):
Xfs it the only one that continue to show near perfect results, with and without synchronized operations. Ext4 shows a strange behavior: it produce better results with synchronous writes that without, moreover its non-synched results had some noticeable run-to-run variance. Btrfs shows very good results only with non-synched writes; with sync-enabled operations it average at over 30 fragments per file. Ext3 in the no-one land: while it is better than btrfs, it is way worse that the others.
Now, the heaviest case: we will check fragmentation after Sysbench random write test...
Fragmentation level skyrockets on this test, proving that no filesystem is immune to this problem. However, not all filesystems are equal, as xfs continue to guarantee a significantly lower fragmentation ratio.