Answer the question
In order to leave comments, you need to log in
The dependence of the speed of the server on the number of files in the folder?
Guru * nix systems, tell me how the speed of the site depends on the number of files in folders?
I have a website with 10K images in one folder and the number is growing fast.
Is it worth it to think about sharing the image storage?
Answer the question
In order to leave comments, you need to log in
Depends on the file system. For ext3/ext4 a large number of files is not a problem.
It is necessary to share, because. it will be more convenient to backup, maintain and develop.
The file system is loaded from the total number of files on the disk (not significantly) and the frequency of access to them, the number of files in the folder is on her drum.
Be sure to share. As the number of files in one directory grows, you yourself will notice slow access to a specific file by its full path, create a couple of levels of subcategories so as not to run into this problem.
And at the expense of the hoster's control panel, the situation is slightly different. The panel scans the contents of your folder, taking into account the number of files, this takes some time.
It is necessary to divide, in a million when the folder is polled, the lag will be visible.
If I'm not mistaken - in nix systems - everything is files: folders, ports, devices, etc. Therefore, she does not care. Files are stored on disk, regardless of folders.
But I would recommend separating by folders. Imagine that you will work (view, delete, etc.) with a list of 50k+ files, for example.
For some reason, in a project with a VERY large number of files, we divided it into folders of the form instead of the name abcdefgh => a/b/c/abcdefgh. Our CTO said that it works faster this way. Although I have not tested in practice.
What I checked, then going into the folder with the same MC with 10K files is not so easy ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question