> -----Original Message-----
>
> Try the frag and freesp commands in xfs_db one reports how fragmented
> things are. So for instance on the laptop I am on which I do kernel
> builds on:
>
> xfs_db: frag -f
> actual 79844, ideal 79633, fragmentation factor 0.26%
> xfs_db: frag -d
> actual 2316, ideal 2249, fragmentation factor 2.89%
---
That's sorta what I was looking for -- I guess I could script
the bmap and find out which files were most affected.
My system looks like: (files/dirs).
/:
xfs_db: actual 152457, ideal 152451, fragmentation factor 0.00%
xfs_db: actual 4090, ideal 3459, fragmentation factor 15.43%
/boot:
xfs_db: actual 58, ideal 58, fragmentation factor 0.00%
xfs_db: actual 2, ideal 2, fragmentation factor 0.00%
/tmp:
xfs_db: actual 6, ideal 6, fragmentation factor 0.00%
xfs_db: actual 0, ideal 0, fragmentation factor 0.00%
/var:
xfs_db: actual 15924, ideal 14822, fragmentation factor 6.92%
xfs_db: actual 276, ideal 206, fragmentation factor 25.36%
/home:
xfs_db: actual 104276, ideal 100041, fragmentation factor 4.06%
xfs_db: actual 4586, ideal 4474, fragmentation factor 2.44%
/backups:
xfs_db: actual 1952, ideal 660, fragmentation factor 66.19%
xfs_db: actual 16, ideal 11, fragmentation factor 31.25%
----
This is with no xfs_fsr (since it doesn't exist on my system)
with
fs's about 9 months old, maybe?
Looks like I could use a good xfs_fsr. Am running SuSE8.1 and
doesn't appear they included it.
> Then freesp lists the sizes of freespace:
>
> from to extents blocks pct
> 1 1 461 461 0.11
> 2 3 335 776 0.18
> 4 7 215 1135 0.26
> 8 15 231 2611 0.60
> 16 31 149 3249 0.75
> 32 63 155 6930 1.60
> 64 127 153 13900 3.21
> 128 255 139 25120 5.80
> 256 511 80 29159 6.74
> 512 1023 40 26903 6.21
> 1024 2047 12 17903 4.14
> 2048 4095 6 18091 4.18
> 4096 8191 1 4628 1.07
> 8192 16383 1 14674 3.39
> 32768 65535 5 267378 61.76
---
So, ideally, would all of the extent ranges have at most 1 extent --
except
for the 32768-65535 range which would have some number of extents
equivalent to something close to free blocks/64K?
thanks for the info...now to write a few scripts...:-)
BTW, a suggestion -- one might want to package a crontab script with
xfs-utils
to try to be consistent with the xfs_fsr manpage where it says "By
default[,]
this is done from crontab once per week." That way packagers might see
the crontab with the documents and look at it and say "oh, we should set
that
up in our distribution".
As for me doing 'timings and testings'...I can add that to my
'list'...of
things it would 'be good to do'...:-). Seriously though -- perhaps I am
naïve, but someone must have thought there was some benefit to be gained
by
having a defrag utility for xfs. As mentioned -- it's not that common
on
*nixes. So I'm wondering what/who (maybe unknown after many years)
prompted
the creation of such a utility. Someone must have thought either
thought
it was needed or that it would make a difference. I realize, though,
that
doesn't mean there was any hard evidence and could have been added on a
whim :-).
linda
|