Blog‎ > ‎

SSDs are immune to file fragmentation? Myth debunked

posted Jun 9, 2014, 10:36 PM by Sami Lehtinen   [ updated Jun 10, 2014, 1:25 AM ]
There was a heated debate in one forum about the fact that if defragging affects SSD file system peformance. Because there wasn't any kind of evidence or conclusion, I had to test it.

Each read test was repeated 10 times and median was picked and whole test set was repeated 10 times including reformatting ntfs partition and on purpose fragmenting it again for the test. All file system caches were flushed between each test. For the tests I used 8 GB partition and 7 GB test file. Read times are in seconds.

Let's get the results.Lower (time) is better.


Fragmented Contiguous
Forward 34.7 s
14.5 s
Reversed 35.7 s
31.2 s
Random 36.1 s
19.0 s

And here's chart for easier readability.

SSD file fragmentation effects

As you can see, SSDs clearly aren't immune to effects of file fragmentation. As far as I can see, it should have been very clear to everyone immediately, but now I have actual proof. I didn't know how large the performance difference was going to be. But I basically knew, there would be a difference. But in this case, performance loss turned out to be over 50%. So defragging can double the file read performance on heavily fragmented files.

File system used for testing was ntfs. But because this is based on very basic data access pattern principles, I strongly assume similar kind of results can be achieved using any file system.

Discussion as well as some background information is here, see the Google+ post.

KW: SSD, fragmentation, defragmentation, defragment, defrag, file system, ntfs, effects, performance, read speed, read performance, does SSD need, should I, recommended, fact, myth, myths, ext4, file system, data, mb/s, gb/s, megabytes, gigabytes, per second, contiguous, sequential, extents, continuous, contiguous,discontinuity, filesystem, blocksize, blocks, clusters, sectors, cluster, sector, block, extent, btrfs, zfs, xfs, filefrag, e4defrag, defraggler, solid state drive, drives, flash, nand, mmc, emmc, contig, defragmenter, free space fragmenation, allocation unit, units, seek, crystal disk, performance testing, test, tests, review, reviews, benchmark, benchmarks, endurance, experiment, experiments, diagnostic, diagnostics, tool, tools, toolbox, usb, stick, sticks, raid, tester, utility, software, benchmarking, memory, storage, rate, rated, devices, database, databases, related, startup, optimization, optimized, comparison, compare, electronic disk, solid state disk, harddisk, hard disk, harddrive, harddrives, hard disks, hard drives, myths, false, claims, bogus, true, really, sas, storage system, difference, faster, slower, better, best, HDD.