4 ms·
With spinning rust the ideal usage pattern is sequential: like writing a large file from the start of a disk into contiguous sectors (or reading that file back)
by raffraffraff 5y ago
With spinning rust the ideal usage pattern is sequential: like writing a large file from the start of a disk into contiguous sectors (or reading that file back).
One of the things that screws up HDD performance much worse than placement of files on disk is randomness in the usage pattern. The mechanical nature of a HDD means that when you read and write lots of small files in different sectors, the head spends more time moving around than reading or writing. Back when we used to defragment Windows filesystems, we doing a bunch of up-front disk optimization to organise files into continuous chunks so they could be read back quickly when needed.
The biggest problem I have seen with these situations is that you don't have direct control over the order of operations that the disk will be asked to perform. You think that because your file is written contiguously that it will be read that way. But depending on how busy the system is, that might not be the case. Where many processes are contending for disk access, and especially when the kernel is doing a lot of swapping to the same device, that head might be racing back and forth regardless of your file placement, and your disk performance goes straight into the toilet.
- lloydatkinson 5y agoYou still do defragment HDDs today
- zozbot234 5y agoModern file systems do not need defragmenting. It was something that was only really done with FAT.
- redis_mlc 5y agoThat is completely false. Typically I saw 30% to 100% performance improvements on ext4 by deleting and restoring database directories. You can see disk fragmentation on linux with the filefrag and other commands.
- kasabali 5y agoext4 also has a defrag tool - e4defrag (8)
- lloydatkinson 5y agoAre you trolling? NTFS.
- bityard 5y agoModern file systems are better at _avoiding_ fragmentation than FAT was, but they are not immune to it.
- kasabali 5y agoThey do, it's just that Windows runs defrag automatically as a background task nowadays so you don't notice.
- bluedino 5y agoOne of the reasons that you'd put /var on another disk back in the old days. Or /home, or wherever your web server stored its files, or your mail files...