We have a security software on Linux which scans for exploits in files that exist in directories on the server (such as if websites had hack scripts uploaded to them).  It defaults to a limit of 10,000 resources per directory or else it won't scan the files in that directory, but it permits setting it to unlimited if desired.  I was thinking of increasing the limit but was wondering if there's something about Linux and lots of files in a directory that causes some sort of non-linear slowdown or some other reason for limiting.  Like would scanning a directory with 50,000 files take exponentially longer than scanning 500 directories of 100 files each or some other reason?EDIT: here are some benchmarks in response to the comments### directory with 50,000 test files #### time for file in *; do echo test > $file; donereal    0m3.432s  user    0m1.128s sys     0m2.303s     # time for file in *; do  a=$(head -1 $file); donereal    1m1.338suser    0m5.878ssys     0m22.885s### directory with 500 test files #### time for i in {1..100}; do ( for file in *; do echo test > $file; done ) ; done real    0m4.150s user    0m1.309s sys     0m2.801s# time for i in {1..100}; do ( for file in *; do a=$(head -1 $file); done ) ; donereal    0m58.278suser    0m3.558ssys     0m18.554s
Reason for security software to not scan directories with more than 10,000 resources in them?
linux;files;directory