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

Re: 5000 Folders in a directory



On 02/17/2016 11:13 AM, Chris wrote:
is it possible to save 5000 folders in the same directory (ext4 FS)
without any performance issues?

It's a Maildir structure with a .-separator, e.g.

/var/vmail/public/folder1
/var/vmail/public/folder1.subfolder1a
/var/vmail/public/folder1.subfolder1b
...

Would it be better to use "real" subfolders with / as separator?

The Wikipedia ext4 article indicates that 5,000 subdirectories should be possible:

    https://en.wikipedia.org/wiki/Ext4

    Increasing the 32,000 subdirectory limit

        In ext3 a directory can have at most 32,000 subdirectories.
    Ext4 allows an unlimited number of subdirectories.[16] To allow for
    larger directories and continued performance, ext4 turns on HTree
    indexes (a specialized version of a B-tree) by default. ...


As for performance, my WAG is that file system directory accesses are a tiny fraction of the overall workload for normal mail server operations, so you could pick either directory structure and performance will be essentially the same. If you need to quantify performance, then you'll have to find or devise meaningful benchmarks.


David


Reply to: