Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Obviously, if you stick a lot of files in one folder, the efficiency of various file operations is going to go down (e.g. ls takes a lot longer). However, what's the limit for how many files you can stick in a folder before it chokes on you? Obviously, this may vary from file system to file system, but I would think that they'd at least be similar in their limits. Can you stuff files in there until you run out of disk space, or are going to run into some sort of limit like you can only put 65536 (or some other multiple of 2) files in a folder before your file system chokes on you?

I'm most interested in jfs, since that's what I use primarily use for my large partitions, but it would be good to know for *nix file systems in general.

share|improve this question
    
possible duplicate of Number of files per directory. You're likely to run into a performance problem before you run into a hard limit. –  Gilles Nov 20 '10 at 11:03

1 Answer 1

up vote 5 down vote accepted

In the old UFS, directory size was limited only by your disk space as directories are just files which - like other files - have effectively unbounded length. I don't know, but expect that JFS is no different.

As to how much is too much, it reminds me of the story of the manager who notices that when there are more than 8 users on the machine, performance drops dramatically so he asks the system administrator to find the 8 in the code and change it to 16. The point being that there is no 8, it is an emergent property of the system as a whole. How to know how big is too big? The only practical way is to add entries until it takes longer than you want. This is obviously a rather subjective approach but there isn't any other.

If you are looking to store 65k+ files, there are probably better approaches depending on the nature of your data and how you wish to access it.

share|improve this answer

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.