[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Inode/Blocksize questions



On Mon, 29 Apr 2002, Michael Renner wrote:
> I'm going to build a maildir-based mailserver with a ~56 gb
> mail-partition. What blocksize/bytes-per-inode/number of inodes should i
> use (i don't want to ran out of inodes and don't want to sacrifice too
> much space for filefragments)?
>
> Is there a drawback when lowering the blocksize/increasing the number of
> inodes (except the maximum filesystem size)?
>
> The inodes used by a file is always filesize divided by the blocksize
> rounded up to the next absolute value, isn't it?
>
> best regards,
> Michael Renner

Hello,

A smaller blocksize will generally result in slower performance.  On the
other hand, you'll lose less space per file with a smaller blocksize.
With default options, the number of inodes mke2fs creates is 1 per 8kB of
disk space.

Looking at my mailbox, my average message size is ~9kB.  For me, the
default number of inodes should be just about right (since each message
uses one inode, and including some extra inodes for directories and other
miscellany).

Inodes used by a file is always one (unless you have multiple links
pointing to the file).  The blocks used by a file is:
    floor(filesize / blocksize) + 1
floor(n) is the greatest integer less than or equal to n (or, n is rounded
down).  Assuming file sizes are randomly distributed, on average (mean)
you'll lose 1/2 block per file.

If you're really worried about space efficiency, then as bad as it may be
to say on the ext3-users list, you may want to consider reiserfs - it
usually benchmarks faster on small files (where "small" is under 15kB, I
think), and is more space-efficient then ext2/3, if you enable tail
packing.

-- 
      -Matt Stegman









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]