From owner-freebsd-fs Wed Aug 2 14: 6: 3 2000 Delivered-To: freebsd-fs@freebsd.org Received: from mail-relay.eunet.no (mail-relay.eunet.no [193.71.71.242]) by hub.freebsd.org (Postfix) with ESMTP id B7C5137B5E4 for ; Wed, 2 Aug 2000 14:05:56 -0700 (PDT) (envelope-from mbendiks@eunet.no) Received: from login-1.eunet.no (login-1.eunet.no [193.75.110.2]) by mail-relay.eunet.no (8.9.3/8.9.3/GN) with ESMTP id XAA85218; Wed, 2 Aug 2000 23:05:54 +0200 (CEST) (envelope-from mbendiks@eunet.no) Received: from localhost (mbendiks@localhost) by login-1.eunet.no (8.9.3/8.8.8) with ESMTP id XAA34926; Wed, 2 Aug 2000 23:05:54 +0200 (CEST) (envelope-from mbendiks@eunet.no) X-Authentication-Warning: login-1.eunet.no: mbendiks owned process doing -bs Date: Wed, 2 Aug 2000 23:05:54 +0200 (CEST) From: Marius Bendiksen To: Steve Carlson Cc: freebsd-fs@FreeBSD.ORG Subject: Re: FFS performance for large directories? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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 Small files or symlinks will usually be no problem, if they stay very small (IIRC, something like 40-60 bytes). However, directory performance may be very poor under many access patterns, due to the employment of linear scans. Also, if multiple levels are traversed depth-first, you will get very poor performance, as FFS uses a width-first layout, giving a worst-case interaction (ref. find(1) and /usr/ports). > 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 These parameters can be tuned by newfs. You may want to go as low as 512 bytes per inode for the layout you've described. > 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. The "safe" number of files in a directory will depend on the length of the names, and how you define "suffer". UFS (which is the terminating layer of FFS et al) uses a linear directory layout. Marius To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message