xfs
[Top] [All Lists]

RE: Defrag Utility

To: LA Walsh <law@xxxxxxxxx>
Subject: RE: Defrag Utility
From: Eric Sandeen <sandeen@xxxxxxx>
Date: 13 Nov 2002 16:20:27 -0600
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <000301c28b60$65e5b770$1403a8c0@sc.tlinx.org>
References: <000301c28b60$65e5b770$1403a8c0@sc.tlinx.org>
Sender: linux-xfs-bounce@xxxxxxxxxxx
Some quick answers...

xfs_db can tell you overall fragmentation, I suppose a wrapper around
this would be nice:

[root@stout root]# xfs_db -r /dev/hda9
xfs_db: frag
actual 408, ideal 408, fragmentation factor 0.00%

actual/ideal are number of extents, factor is something like 
(actual - ideal) / ideal

xfs_bmap can show you the actual number of extents in a file.

xfs does try to place files in the same directory in the same
"allocation group," which is a sub-chunk of the filesystem.

fsr does not defrag freespace.

xfs doesn't generally need much defragmentation, although certain types
of writes (sync, for example) -can- fragment files pretty badly.

If you'd like to do some of the performance measuerements you talk
about, let us know.  :)

-Eric

On Wed, 2002-11-13 at 16:02, LA Walsh wrote:
> Is there any tool to tell how many files have how many fragments out of
> how many files...something on the order of
> 
> the following files have more than 1 fragment:
> frags                 file
> 2                     /tmp/xyzzy
> 35                    /var/mail/box
> ...
> 37 objects out of 1000 total, >1 fragment: 3.7% fragmented objects
> 1100 fragments total,  10% fragmented file space (1000 optimal
> fragments)
> [are xfs allocates are done in "zones"? so similar files in same
> directory
>  are usually near each other on disk?]  Does it make sense to talk about
>  'free space fragmentation'?   
>  For example,
>  on a 'start from beginning' FS like FAT32, optimal may be 1 large area
>  of free space, except for an extra segment or so after frequently-
>  modified-files, but if a disk was, in some way zoned, optimal might 
>  be 100 areas of freespace]
>  110 free space fragments (50 optimal) 55% fragmention.
> 
> Does xfs_fsr defrag freespace as well?  Any idea on how much
> fragmentation
> affects performance on xfs?  Is it on the same order that it is on FAT32
> or
> NTFS?  I've read (perhaps it was defrat company propaganda), that while
> FAT
> could be defragemented on an occasional, as needed basis, NTFS needed
> more
> aggressive fragmentation -- so much so that an auto defragger in
> background 
> could be useful in some circumstances.  
> 
> I've tended to think of *nix fs's as not usually needing defragmenting
> if
> they were kept below 90% capacity, I think xfs's defragmenter is the
> first I've
> heard of on a *nix.  
> 
> Order on disk correlated to execution order after boot can affect boot
> performance on WindowsXP by over 100%.  Have there been any measurements
> on block ordering with xfs (or any *nix fs's for that matter)...
> 
> -linda
> 
> 
> 
> > -----Original Message-----
> > From: linux-xfs-bounce@xxxxxxxxxxx 
> > [mailto:linux-xfs-bounce@xxxxxxxxxxx] On Behalf Of Chris Wedgwood
> > Sent: Saturday, November 02, 2002 3:04 PM
> > To: mgiesbre
> > Cc: linux-xfs@xxxxxxxxxxx
> > Subject: Re: Defrag Utility
> > 
> > 
> > On Thu, Nov 02, 2000 at 05:06:02PM -0600, mgiesbre wrote:
> > 
> > > I was wondering if there was any work being done on an XFS defrag
> > > utility, like the command that is available in IRIX.  Any info?
> > 
> > man xfs_fsr
> > 
> > 
> >   --cw
> > 
> > 
> > 
> 
-- 
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@xxxxxxx   SGI, Inc.         651-683-3102


<Prev in Thread] Current Thread [Next in Thread>