in reply to Ideal buffer size..

A buffer size equal to or a multiple of your filesystem block size is optimal (assuming your filesystem block size is optimal for the storage type/ stripe size etc on the raw device).


-Waswas

Replies are listed 'Best First'.
Re: Re: Ideal buffer size..
by kiat (Vicar) on Apr 22, 2004 at 04:10 UTC
    Thansk, waswas-fng!

    Is there a generic size that fits all?

    :)

      For this particular case, any number would work fine really. If you want to be part of the "in-crowd", just use a multiple of 1024 (the 16384 you see in that code is 1024*16). It's really up to you though... depends on how much memory you want to use up at any given time.

      Of course not :)

      But most OS's seem to use 4096 bytes (that is, four kilobytes), so you should be OK with that.

        Thanks William!

        I've changed the buffer size ot 4096 :)