Skip site navigation (1)Skip section navigation (2)
Date:      13 Dec 2000 12:53:54 +0100
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        Gustavo Vieira Goncalves Coelho Rios <gustavo@ifour.com.br>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: very big mail spool directory
Message-ID:  <xzpsnns4jvx.fsf@flood.ping.uio.no>
In-Reply-To: Gustavo Vieira Goncalves Coelho Rios's message of "Tue, 12 Dec 2000 20:50:20 %2B0000"
References:  <3A368F8C.1918684F@ifour.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help
Gustavo Vieira Goncalves Coelho Rios <gustavo@ifour.com.br> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpsnns4jvx.fsf>