ZFS fragmentation

Code:
zroot  3.62T  2.94T   703G         -    57%    81%  1.00x  ONLINE  -

Why has it so much fragmentation and how can I fix this. The answer to where the problem is, is probably snapshots. But, how can I fix this.
 
From everything that I have read, the only way to really defragment a ZFS pool is to copy the data to another pool and recopy it back.
 
While I won't pretend to understand all the technical details, it is my understanding that fragmentation on ZFS doesn't mean quite the same thing that it does on other filesystems, and---I don't recall exactly where I saw this---fragmentation on a pool shouldn't start having a problematic impact until it reaches around 80%.

Just for the sake of illustration: I created two brand-new pools on two new disks one week ago today. The two pools report 31% and 52% fragmentation, respectively. The pool with 52% fragmentation is about 2.7TB in size, and is 68% full. In the week since it was created, the pool has seen perhaps 60 GB of writes. Meanwhile, the pool with 31% fragmentation is only 20GB in size and is 60% full, has seen probably 40GB-50GB of writes---at least twice its total capacity.

So the smaller, more active pool is less fragmented, and both pools are only one week old. It seems the FRAG value cannot represent the same sort of file fragmentation that degrades I/O performance on other filesystems.
 
Hello,

From what I know fragmentation is used usually to get all the data as close as possible to the beginning of the disk (near the edge of the curcle), because during rotation the needle walks through larger surface and read/write more data. This is suppose to speed up the performance.

However I don't remember where, but some time ago I read a blog that says ZFS fragmentation is good, because it means the data is spread on the entire disk and same goes for the "free space" tracks which redse the time needed for reposition of the needle. It will just find the closest place with free and large enough space and it will write the data there.

So if what I read was true the fragmentation is good for ZFS.
 
I wouldn't say so, if you read the article I linked it says that the fragmentation is purely a measure of how fragmented the free space in a pool is. Highly fragmented free space is never a good thing.
 
Back
Top