Received: with ECARTIS (v1.0.0; list linux-xfs); Wed, 13 Nov 2002 17:38:05 -0800 (PST) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.58.33]) by oss.sgi.com (8.12.5/8.12.5) with SMTP id gAE1c2uR019633 for ; Wed, 13 Nov 2002 17:38:02 -0800 Received: from Shiva (shiva [192.168.3.20]) by ishtar.tlinx.org (8.12.6/8.12.2/SuSE Linux 0.6) with ESMTP id gAE1dYg2007702; Wed, 13 Nov 2002 17:39:34 -0800 From: "LA Walsh" To: "'Stephen Lord'" Cc: Subject: RE: Defrag Utility Date: Wed, 13 Nov 2002 17:39:32 -0800 Message-ID: <001e01c28b7e$ae07eb90$1403a8c0@sc.tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: <1037226106.1351.32.camel@laptop.americas.sgi.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id gAE1c2uR019638 X-archive-position: 1698 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: law@tlinx.org Precedence: bulk X-list: linux-xfs > -----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