Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am using the following structure to save the images that users are uploading for their items:

  • Images
    • User_dir1
      • Item_dir1
        • Picture_file1
        • Picture_file2
    • User_dir2
      • Item_dir2
        • Picture_file3
      • Item_dir3
        • Picture_file4

Can I go on with this if I am going to have thousants of users and hundrets of items per user? Talking about performance will the Linux dedicated server have trouble in the future?

Thanks!

share|improve this question
2  
This site is probably not the best place to ask this question. I would suggest ServerFault. –  Walter Nov 11 '10 at 12:03
add comment

3 Answers

up vote 1 down vote accepted

Well, how much time does it take to create a thousand folders over the course of say a month? I would argue not a lot. It would take a lot of time if you were regularly removing and creating folders, but it seems to me the only files that will be changed regularly will be the picture files themselves (or at worst, the folders themselves initially as they won't exist at first, but that will diminish over time), which is the same as if you had lumped everything in a single folder to begin with.

Obviously keep an eye on space and state of defragmentation of your disk, but with a little maintenance, I wouldn't expect a lot of difficulty in your idea.

share|improve this answer
add comment

Unless you'll need more than 65534 folders per directory you should be okay (apparently this is the maximum for NTFS)

share|improve this answer
1  
you get slowdown on some tasks way before that. any time you suspect you'll have thousands of items, you should split directories –  Javier Nov 11 '10 at 15:24
    
Thats true I was stating the absolute maximum –  billy.bob Nov 11 '10 at 16:42
add comment

It's most likely much better than putting all files into one large directory; some file systems do not really like having tens of thousands of files in on directory.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.