title: Is it OK (performance-wise) to have hundreds or thousands of files in the same Linux directory?
body: <p>It's well known that in Windows a directory with too many files will have a terrible performance when you try to open one of them. I have a program that is to execute only in Linux (currently it's on Debian-Lenny, but I don't want to be specific about this distro) and writes many files to the same directory (which acts somewhat as a repository). By "many" I mean tens each day, meaning that after one year I expect to have something like 5000-10000 files. They are meant to be kept (once a file is created, it's never deleted) and it is assumed that the hard disk has the required capacity (if not, it should be upgraded). Those files have a wide range of sizes, from a few KB to tens of MB (but not much more than that). The names are always numeric values, incrementally generated.
  I'm worried about long-term performance degradation, so I'd ask:</p>
  
  <ul>
  <li>Is it OK to write all to the same directory? Or should I think about creating a set of subdirectories for every X files? </li>
  <li>Should I require a specific filesystem to be used for such directory?</li>
  <li>What would be the more robust alternative? Specialized filesystem? Which?</li>
  <li>Any other considerations/recomendations?</li>
  </ul>