Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2000 15:44:57 -0400 (EDT)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        Steve Carlson <stevec@nbci.com>
Cc:        freebsd-fs@FreeBSD.ORG
Subject:   Re: FFS performance for large directories?
Message-ID:  <Pine.SOL.4.21.0007311534090.1395-100000@sol.cs.binghamton.edu>
In-Reply-To: <B5AB2266.BEA%stevec@nbci.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 31 Jul 2000, Steve Carlson wrote:

>     First off, my apologies in advance if this is not the type of technical
> question expected in this forum - I checked the charter and archives to get
> a feel for the theme, but still wasn't sure if this would be inappropriate.
> -questions was no help, either...
>     I'm trying to figure out at what point I can expect performance issues
> with an FFS filesystem if I have directories with a massive number of small
> files or symlinks.  As far as I understand it, there are a number of inodes
> located within a cylinder group, and the inodes for files are ideally placed
> in the same cylinder group as their parent directory.  But if I were to have
> a massive number of small files or symlinks in a directory, wouldn't I run
> out of local inodes and thus start to see a performance issue when working
> in that directory?  How can I determine the maximum number of files I should
> safely place in a directory without my performance suffering?  I've been
> unable to find commentary on this in print or on the web - everything I've
> read centers only on performance issues when the disk becomes full.

Since nobody answer your question, let me try:

FFS is not very good at large directories because it has to search the
directory linearly.  If you have 1000 entries in a directory, then on the
average, you have to search 1000/2 entries before you can get the entry
you want. Other solutions exist, such as B*-Tree or Hash table. They will
speed up directories look up time.

Having said this, you can try to put all directory file into the
memory.  This is the idea of matt's VMIO directory.  You can definitely
find discussions on this in the mailing list archive.

A third thing is that FFS performs poor accessing /usr/ports.  This has
something to do with how FFS layout directory inode (not file inode). The
book 4.4 BSD design and implementation explains this well.  If fact, read
that book carefully, you can have better idea than you can get from a
mailing list.  Good luck!

-Zhihui



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0007311534090.1395-100000>