|
|
Subject:
Optimal maximum number of files in a directory
Category: Computers > Operating Systems Asked by: fokfok-ga List Price: $20.00 |
Posted:
19 Sep 2004 19:32 PDT
Expires: 19 Oct 2004 19:32 PDT Question ID: 403516 |
I am using Redhat Fedora Core 2 and I am implementing a file storage system. I will give a unique ID to each file, hash the ID and store it to the respective directory. so if there are 10,000,000 files, and SUPPOSE the optimal maximum number of files that a directory can hold is 1000, i will be storing the 42455th files at /0/42/42455.ext. So my question is, what is the optimal maximum number of files that a directory can hold in fedora core 2 ext 3 file system? I need that number so that the least number of levels of folders is needed. Please post the answer here with supportive information. | |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: Optimal maximum number of files in a directory
From: efn-ga on 20 Sep 2004 22:12 PDT |
OK, I think I understand the question better now, but I find some of your assumptions questionable. I think there is a maximum number of files per directory, at least in the ext3 file system. If only that were your question, I could sell you an answer! I doubt that the data for a directory is stored in a number of "index files," any one of which, and no more, can be read in one disk operation. Actually, a directory is a file, and in ext3, a directory is a linked list of variable-length entries, so the length of the file names you use is a factor in the analysis. You might be able to improve performance by leaving the ".ext" off the file names. In current systems, the operating system or the file system may cache data in main memory and the disk drive hardware may have a cache of its own, so the number of relatively slow electromechanical disk operations required can be hard to predict. It might be more effective to test various directory size values than to rely on a theoretically optimal number. Still, it is understandable that you would be interested in the optimal number. Unfortunately, I don't have the time and file system wizardry to figure it out myself. I hope someone else here can help you. If not, you might try asking in a Linux forum. Good luck, --efn |
Subject:
Re: Optimal maximum number of files in a directory
From: cscguy-ga on 21 Sep 2004 14:39 PDT |
Yes, there are maximum numbers of files in directories. Unfortunately, I am not familiar with Linux. But on BSD you usually type tunefs to change various tunable filesystem settings such as average filesize, whether the operating system is tuned for space allocation or time etc. This feature should also be available for ext2/ext3 file systems also. You can try to see if tunefs exists for Linux also, or you can try a search in google to see if you can find the equivalent tool for Linux. Hopefully this can help. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |