[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using hash directories

Emmanuel Lacour wrote:
> Hi,
> I would like to understand why some softwares such as postfix or squid
> uses hash of directories like:
> a/a/
> b/a/
> c/a/
> d/a/darmond
> e/a/
> f/a/
> for their spools.
> I will set up a server for a lot of mail accounts (~20000) with
> postfix+ldap+maildrop+courier-imap, so is it better to put 
> all Maildirs
> in /home/vmail/ directly or using hash directories? What are the
> benefits?

this is because many file systems out there get very slow when they have
some 1000 files in one directory. This is true for at least "older" file
systems, like ext2, minix, probably ext3 too (because it's basically

I did some tests with ext2 and reiserfs for some project, and found it was
fastest to only have _one_ hash level (256 dirs) for ~50000 files, as system
load went up dramatically when I introduced the second hash level. But
that's another story.


Reply to: