From owner-freebsd-hackers Wed Dec 13 3:55:13 2000 From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 13 03:55:11 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 87D5A37B402 for ; Wed, 13 Dec 2000 03:55:10 -0800 (PST) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id MAA66089; Wed, 13 Dec 2000 12:53:55 +0100 (CET) (envelope-from des@ofug.org) Sender: des@ofug.org X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Gustavo Vieira Goncalves Coelho Rios Cc: hackers@FreeBSD.ORG Subject: Re: very big mail spool directory References: <3A368F8C.1918684F@ifour.com.br> From: Dag-Erling Smorgrav Date: 13 Dec 2000 12:53:54 +0100 In-Reply-To: Gustavo Vieira Goncalves Coelho Rios's message of "Tue, 12 Dec 2000 20:50:20 +0000" Message-ID: Lines: 21 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Gustavo Vieira Goncalves Coelho Rios writes: > The functions that will hash the id, accepts an id as input and returns > a string for the user dir, like: > > Id String returned > 0 0/0/0/0/0/0/0/0 > [..] That gives you 2^32 leaf directories plus approximately 2^28 intermediate directories, which is a helluva lot of inodes (4581298448 to be exact), and your files will be spread all over your disk(s), throwing performance down the drain. If you only have half a million users, pick a prime number K close to the square root of the expected number of users (724 in your case - closest primes are 719 and 727), create that many bucket directories, and place each user in bucket ID mod K. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message