Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Bob Harris <harris@zk3.dec.com>
Subject: Re: Performance problem (I/O)
Date: Mon, 22 Mar 2004 18:25:05 GMT	[thread overview]
Message-ID: <harris-454DDC.13153922032004@cacnews.cac.cpqcorp.net> (raw)
In-Reply-To: c3n2v0$1etc$2@jeeves.eng.abbnm.com

In article <c3n2v0$1etc$2@jeeves.eng.abbnm.com>,
 peter@abbnm.com (Peter da Silva) wrote:

> In article <harris-779E4E.23395720032004@cacnews.cac.cpqcorp.net>,
> Bob Harris  <harris@zk3.dec.com> wrote:
> > I'm not sure I understand the question.  I think, based on what you have 
> > extracted above, you are wondering if AdvFS defers the 8K allocation 
> > until after the frag has been created, and just what I/O really occurs.  
> > Is this correct?
> 
> Yes, and thanks for the detailed and interesting explanation. I think I
> followed it all, though of course I might be completely misinterpreting
> something so if I go ahead and turn off fragging and it makes things
> worse I won't blame you. :)

The most important thing to know about turning off small file frag'ing 
is that it can consume a lot more disk space.   If you have the disk 
space, then it doesn't matter.  

Also remember that turning off small file frag'ing only affects new 
files or existing files that are extended.  All other small files with 
frag will keep their frags.

Attached is a script that may give you an estimate of how much extra 
space will be needed if all the small files on the file system were 
created without frags.  It is brand new code, so there could be bugs in 
it.

                                        Bob Harris

#!/bin/ksh
#
# estimate_extra_storage_needed_if_no_small_file_frags.ksh /mount_point
#

find $1 -xdev -type f -ls 2>/dev/null |\
awk '
    BEGIN {
        ONE_K   = 1024
        SEVEN_K = (ONE_K * 7)
        EIGHT_K = (ONE_K * 8)
        FRAG_PERCENT = 5
        SIZE_LIMIT = ((EIGHT_K - 1) * 100) / FRAG_PERCENT
    }
    $7 !~ /[0-9]+/ { size = $6 }
    $7  ~ /[0-9]+/ { size = $7 }
    {
        fragsize = size % EIGHT_K
        if (fragsize == 0 || fragsize > SEVEN_K || size >= SIZE_LIMIT) {
            next        # not a canidate 
        }
        frag_storage = int((fragsize + (ONE_K-1)) / ONE_K)
        increased_storage = 8 - frag_storage
        total_storage_increase += increased_storage
    }
    END { 
        print "Disabling small file fragging will need approx"
        if ( total_storage_increase < (10*1024) ) {
            print total_storage_increase, "Kilobytes more storage" 
        }
        else if ( total_storage_increase < (10*1024*1024) ) {
            total_storage_increase /= 1024
            print total_storage_increase, "Megabytes more storage" 
        }
        else {
            total_storage_increase /= (1024*1024)
            print total_storage_increase, "Gigabytes more storage" 
        }
    }
' 
exit


      reply	other threads:[~2004-03-22 18:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 13:27 Performance problem (I/O) Fredrik
2004-03-16  1:44 ` Bob Harris
2004-03-18 12:01   ` Fredrik
2004-03-19  2:26     ` Bob Harris
2004-03-19 19:44       ` Peter da Silva
2004-03-20  0:01         ` Bob Harris
2004-03-20  0:12           ` Peter da Silva
2004-03-20  1:04             ` Bob Harris
2004-03-20 23:36               ` Peter da Silva
2004-03-21  4:48                 ` Bob Harris
2004-03-22 16:06                   ` Peter da Silva
2004-03-22 18:25                     ` Bob Harris [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox