I want to manage a huge number of files on my server (say millions). It is needed to save files in two or three levels of folders to keep the number of files in each folder low. On the other hand, it is not good to have many folders to spend inodes.
How much is the optimum ratio of files per folder? Is there a theoretical approach to determine this, or it depends on the server specifications?