Many images in the same directory


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
On the server images are given with the help of the nginx server.

How much is the maximum you can place images in 1 directory to the ext3 filesystem that does not increase the time of random access files and does not appear no unnecessary extra load due to search of files in the directory with a huge number of files?

Accordingly the same question about directories: no subdirectories in the directory it is best to limit?

What are the limitations on the lengths of the names of the directories and files should be applied, not to an increase in the search time, what are the limitations on the levels of nesting?

The same question interested (but not in practical and educational purposes) for FS reiserfs, ext4, xfs, jfs... And which of these FS is better cope with such a task?
by | 5 views

6 Answers

0 like 0 dislike
In ancient times, was devised a method to store plenty of files on this principle:
1) was: /files/abcdefg.gif
2) became: /files/a/b/c/abcdefg.gif
The depth of nesting greater than 3 in practice never seen, and delays. Here is the first recipe — the delays were, but was still ext2, and several thousands of files in a folder. The exact figures, unfortunately, do not remember behind prescription of years.
by
0 like 0 dislike
the limitation for ext3 is 32k is the number of subdirectories in one directory proof.
ext2 — the theoretical limit of 256k files in the directory.
in ext3 — it is possible to calculate almost razmatrali/8192 proof
and the idea spread across the subdirectories is IMHO correct, but not hash content,
but, for example if the index (which file in which path is) in the DBMS or a separate file, then you can smear on the content of the subdirectory count of files or the total size of the directory, round robin,
or even hash, but not the contents of the file and the file name.
\r
he kept a log of gentechnik disfiles about 60tys files on ext3: of course the list of files in the directory took a lot of time, despite dir_index. but the choice was not: filipovica was on RHEL4, and there is nothing but ext3 is not supported.
on the other machine was able to build the module for xfs, moved the caching to it: the number has increased to 300 thousands of files flying General (particularly pleased with the shadow defragmentation and quick removing large files from ext3 with that ass, but sometimes the module fails)
by
0 like 0 dislike
for small files, reiserfs is better for the other ext*
About storage in solidarity with Bambr. Is that look in the direction of mogilefs
by
0 like 0 dislike
The maximum file in one directory for ext3 I think about 32K
To place the files evenly throughout the subdirectories works best such a scheme. m5sum(file) = a1b2c3... Then the file is placed in /a/1b/filename... to get 100k fail on 23-25 of files in a directory
by
0 like 0 dislike
just for access to 5-10 thousand can not bathe
by
0 like 0 dislike
I used to front-cache(two gigs) + 4 gig pictures(700K chtuk) $1/$2/md5(name) where $1-$2 — two first and two second character md5 name.
\r
Now stored in the cache and mysql.
The reason is simple — when I had to move to another server archiving daddy took 6 hours...
by

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
7 answers
0 like 0 dislike
1 answer
0 like 0 dislike
6 answers
110,608 questions
257,186 answers
0 comments
25,048 users