Which filesystems are we talking about?

ZFS, BTRFS

Why is fragmentation bad?

It causes performance issues. Specifically bandwidth and more importantly latency. For Virtualized environments, you want the lowest latency as possible (so that data is immediately responded). If it takes the storage many millisconds, vs a few microseconds to respond with, then the virtualized environment, might just drop your storage out of the equation and you will lose access to your VMS (down the road too, not immediately, so you will be fumbled with running VMs that are dropping off like … droppings)

How to lower fragmentation in COW filesystem?

Turn off COW on the share/folder/file – COW encourages new writes to be written in new places. For applicaitons that use lots of small and random writes, this will lead to fragmentation down the road, as all of those random writes will be written in new spots. BTRFS has this.

Turn off SNAPSHOTS – as you can imagine that has to keep a whole new track of data.

Turn off ASYNC writes, lots of filesystems will have more time to queue up writes and have a better chance to write in a contiguous manner before laying the data on the drives – where as sync will ask for the write to be immeidately written to the drive

Lower Thread count – The more threads something writes with, then the more fragmented the data will be. Even if your processor supports many threads, this fragmentation will still happen. Its not a big effect but it will happen.

Run maintenance tools – such as Filesystem Defragmenter (BTRFS has this)

Leave a Reply

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