Re: 5000 Folders in a directory
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, Feb 17, 2016 at 02:03:25PM -0800, David Christensen wrote:
> 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.
Of course (and this goes also for my other post) don't expect an
"ls -l" on such a monster directory to be fast. And be prepared
for shell globbing (e.g. "rm *.bat") to go haywire from time to
time. But that's not the file system's problem. Thats not how you
use such monster dirs :-)
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlbFeksACgkQBcgs9XrR2kZKPgCeP/qSsuG9qL0UDJlOJv+8AsrB
RgkAnA2e9akML/l7AF4/ypB2cqJG9LNw
=jrY0
-----END PGP SIGNATURE-----
Reply to: