Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 1999 09:06:35 -0500
From:      Graeme Tait <U@webcom.com>
To:        Greg Lehey <grog@lemis.com>
Cc:        Dan Busarow <dan@dpcsys.com>, "Michael G." <mikegoe@ibm.net>, "freebsd-questions@FreeBSD.ORG" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: FreeBSD Cluster Size
Message-ID:  <3698B3EB.502A@webcom.com>
References:  <199901100629.GAA119060@out4.ibm.net> <Pine.BSF.3.96.990109223458.19191A-100000@java.dpcsys.com> <19990110195247.X8886@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Greg Lehey wrote:

> > I believe that a UFS fragment would correspond to a FAT cluster.
> > The default value for fragments is 1024 bytes and is independent
> > of the filesystem size.
> 
> It's dependent on the block size, though.  If you have a file system
> with lots of small files, you can save by allocating 4 kB blocks and
> 512 byte frags.


I think this may be one of those rare  ;-)  occasions where having more 
filesystems could be justified.

I have lots of small (~1000 to ~1800 byte) files in a webserver system. 
Following Greg's instructions, I rebuilt the system to have 512 byte 
fragments, and more inodes (as there weren't enough with default newfs 
setting). However, I restricted this to a special filesystem /usr/www, 
partly because the modified settings are less efficient for larger 
files, and also to allow mounting this file system async and noatime. 
The "async" *greatly* improves speed of file deletion/creation from tar 
archives. I'll try soft updates when I move to 3.x .

BTW, the site owner presently generates these files on a Windows system. 
Until he switched to a third-party partitioning program, it was 
impossible to fit more than a few hundred MB of these files in 6GB of 
disk!


Another thought about having multiple filesystems. If you had a certain 
class of files (say in /usr/www) that were heavily used, would it not be 
more efficient to have a dedicated filesystem slightly larger than 
necessary to fit the files? This would confine head movements for 
accessing these files to a smaller range of cylinders. With a single 
large file system on the disk, and frequent file modification, I assume 
eventually the files would end up scattered over a much wider range of 
cylinders, at least if the disk was fairly full.


A question in this regard. If I do ls -li on a new filesystem, I notice 
files and directories at the file system root are widely spaced in inode 
number, even when the disk is relatively empty. Doesn't this mean more 
head movement than might otherwise be achieved?


-- 
Graeme Tait - Echidna


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3698B3EB.502A>