Advertisement

[x]
Attachment Details

Large number of files / Directory structure question

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8
Zone: Linux
What is the best way to organize a large number of files (and by large i mean about 1,000,000 jpg files).  Right now I have a directory called photos.  Within that directory is a folder for each userid.  Within that folder are 3 more folders called thumbnails, images, and large which hold the 3 different size variations of the photo.  Each photo is named after its unique photoId from 1 to 1,000,000.  So for example my directory structure for user id 10 who has a photo of photo id 1445 would look like this.

photos/10/large/1445.jpg
photos/10/images/1445.jpg
photos/10/thumbnails/1445.jpg

So my question is, does it matter that /photos/ will have 1,000,000 directories in it?  Or would it benefit me to do something like:

photos/1/10/large/1445.jpg

where /1/ is a directory containing users 1-10,000. /2/ could contain users 10,001 to 20,000, etc

Are there speed concerns? Will the directory get to big and just come to a screeching halt?  What is the recommended max size of files/folders to have in one directory?

I'm running on a big host on an unknown GNU/Linux. PHP Version 4.4.1.

Thanks.

Related Solutions
Related Solutions
 
Loading Advertisement...
 

Rank: Guru

Accepted Solution by slyong:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 

Rank: Sage

Expert Comment by jlevie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Expert Comment by chill633:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by burnsj2:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Expert Comment by chill633:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by burnsj2:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Expert Comment by chill633:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Expert Comment by chill633:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
Loading Advertisement...
20080924-EE-VQP-41