Block Size (FreeBSD File System)

VeeJay maanjee at gmail.com
Fri Nov 17 02:15:07 PST 2006


* Hello there

I am building a Web Server with 4 x 146GB SAS disks (using RAID 10) with
FreeBSD 6.1, Apache 2 & MySQL.

I have read this below quoted information that to increase performance, one
can set a Block Size. If so, how much? Could some genius advise what to do?

I am having over 100GB for /var, 100GB for /home, 256MB for /root, 16GB for
/swap, 4GB for /usr, etc.

Block Size

This section contains options that can really impair system performance. If
you're new to FreeBSD,

take the defaults! This is for experienced UNIX administrators who know
exactly what they're doing.

Block size refers to the minimum size of a file. If you have a file that
contains just one tiny character,

it uses one whole block, even if it barely fills that block. By the same
token, if your file is just over

the block size, it takes up one block and a fragment of another. Each block
can be divided into

fragments, so that multiple, slightly oversized files can use one block to
store their extra tidbits.

FreeBSD defaults to 8KB blocks. If you're creating a large partition―say,
1GB or more―use 16KB

blocks. When you do this, you also need to change your fragment size. The
FreeBSD file system

(UFS, or UNIX File System) works best with fragments one−eighth the size of
a block. This would

be 16,384−byte blocks and 2,048−bit fragments.

Set the block size with the newfs program. From the Disklabel screen, press
N while on a partition

to display a pop−up dialog box containing newfs options. To use 16KB blocks
and 2KB fragments,

enter

....................................................................................................

newfs −f 2048 −b 16384

....................................................................................................
-- 
Thanks!

BR / vj
*


More information about the freebsd-questions mailing list