2 question about XFS fragmentation and _fsr: SPLITTED Q1:sparse files

Eric Sandeen sandeen at sandeen.net
Wed Apr 27 15:37:36 CDT 2011


On 4/27/11 3:18 PM, Eric Sandeen wrote:
> On 4/26/11 4:51 PM, Janos Haar wrote:
> 
> <snip>
> 
>>>> In the result, actually we have >6TB images on the 3TB disk, wich is
>>>> 97.9% fragmented.
>>>
>>> How are you determining that figure?
>>
>> [root at UNISTORE admin]# cat xfs_get_frat_ratio
>> echo loop0
>> xfs_db -c frag -r /dev/loop0
>> [root at UNISTORE admin]# ./xfs_get_frat_ratio
>> loop0
>> actual 7650952, ideal 752501, fragmentation factor 90.16%

btw we should just nuke that stupid command ;)

> so you had 7650952 extents on the fs, ideally you'd have 752501, or so xfs_db says...
> 
> Another way of looking at this is that you have about 10 extents per file on average.
> 
> Depending on the size of the files, this may be perfectly fine.
> Is, for example, a 10G file in ten 1G extents really a problem?
> 
> I doubt that fragmentation is your performance problem here.

... note however that you can use xfs_bmap to examine the layout of any particular file.

10 on average may be 1 for most, and 10,000 for the last one.   :)

-Eric




More information about the xfs mailing list