Hacker News new | ask | show | jobs
by Terr_ 1057 days ago
I once had to administer a system where a particular folder had so many files that things stopped working, even the ls command would not complete. (It was probably on ext3 or ext2.)

The workaround involved writing a python script that handled everything in a gradual manner, moving files into subdirectories based on shared prefixes.

1 comments

oh yes. ls uses 4k buffers for dirents, and in a directory with lots of entries, the time for userspace to hit the kernel to list the entities until that 4k buffer is full, back in the day, became noticable. In my dealings with a system like that, I had a hacked copy of ls that used bigger buffers so at least it wouldn't hang. Tab completion would also hang if there were too many entries.