> My spool root is: /var/qmail/mail and every user dir is lied into this
> directory.
> The user directory is given by a function hash, this function gets the
> id and return a path to it, for instance:
>
> id Relative path to /var/qmail/mail
> 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
>
> Got the ideia ?
>
> I would like to hear from you if my approach is good (performance in
> mind). To get into the user maildir, i get at most 16*8 lookup_dir
> routines, so at least it's better than having all user dir into a single
> directory. My approach is only better if you have morer than 16*8 pop
> accounts.
The basic idea is good, but I think your directory tree is
much deeper than neccesary. If you use NFS, I think it will have
a performance impact.
On my system I also map each account to a number which is used to
construct the path to the mailbox, but I only use three levels,
something like this:
/var/mail/26/83/username
These mailboxes are distrubuted across 100 x 100 = 10000 directories,
which is probably sufficient for up to 10 million users.
--
Gjermund Sorseth