From owner-freebsd-hackers Tue Dec 12 14:51:45 2000 From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 12 14:51:43 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from ifour.com.br (unknown [200.236.148.68]) by hub.freebsd.org (Postfix) with SMTP id 92F2C37B400 for ; Tue, 12 Dec 2000 14:51:36 -0800 (PST) Received: (qmail 68718 invoked from network); 12 Dec 2000 19:58:38 -0000 Received: from port47.tdnet.com.br (HELO ifour.com.br) (200.236.148.147) by midas.ifour.com.br with SMTP; 12 Dec 2000 19:58:38 -0000 Sender: grios@FreeBSD.ORG Message-ID: <3A368F8C.1918684F@ifour.com.br> Date: Tue, 12 Dec 2000 20:50:20 +0000 From: Gustavo Vieira Goncalves Coelho Rios X-Mailer: Mozilla 4.72 [en] (X11; I; FreeBSD 4.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: hackers@freebsd.org Subject: very big mail spool directory Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi folks, i am planning a very big email server, currently i am planning for about 8*2^16 users. I known that ufs has not good performance for very big directories, i.e., using a single directory to hold too many entries may lead to a low level performance.Since, my approach is to hash the spool mail dir for my users. Every user will have a single id that will map it's email address into a unique directory, this later will hold the user maildir. My spool mail dir is: /var/qmail/mail and all directory will be created within' it. 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 1 0/0/0/0/0/0/0/1 . ./././././././. 15 0/0/0/0/0/0/0/f 16 0/0/0/0/0/0/1/0 17 0/0/0/0/0/0/1/1 . ./././././././. 32 0/0/0/0/0/0/2/0 . ./././././././. Got the ideia ? This allow me to perform at most 8*16 lookup_dir routine to get the users mails. So, my approach only works better for a number of users bigger than 96 in traditional /var/mail (that creates one file for each user, what can make performance drop down for a large amount of users). I believe my approach is very good, since if you have (for instance) 2^32 users, seeking the user dir would not take too much time! Any way i would really enjoy your comments. What you wizard have to say about my approach? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message