A
A
Arman2015-11-30 10:28:00
linux
Arman, 2015-11-30 10:28:00

How much better to store files in one folder 256 or 4096?

DD. Yes, the question has been raised more than once, but now I have live data in my hands - a bunch of small files, naturally we spread everything into subfolders, we have the ability to split 256 subfolders / files into one directory or 4096, in the first case there are three levels, in the second two:
/d5/fc/39/ vs /d5f/c39/
What is better to choose here? On the one hand, 256 files are somehow small (?) in one folder, and on the other hand, 4096 are a lot (?) for one folder?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2015-11-30
@Arik

ext4 - don't care
If there is a need to watch files manually, then it all depends on your file browser

S
s0ci0pat, 2015-11-30
@s0ci0pat

I have a file server. The photo archive contains directories with a large number of files, more than 256.

O
Oleg Tsilyurik, 2015-11-30
@Olej

This is not directly related to your question, but look at your system for limiting the number of open files:

[email protected] ~ $ ulimit -n -S
1024
[email protected] ~ $ ulimit -n -H
4096

In principle, this can suggest the order of the (convenient) number of files in one directory.

E
Eddy_Em, 2015-11-30
@Eddy_Em

Depends only on the file system. Let's say reiserfs somehow doesn't work very fast if there are millions of files in the directory. And about btrfs reviews are much better.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question