[SLL] limit on number of files in a directory and hashed dir vs. flat dir file access time

Andrew Sweger andrew at sweger.net
Thu Nov 1 14:35:13 PDT 2007


On Thu, 1 Nov 2007, Brian Hatch wrote:

> You can use 'ls -f' to disable sorting.  It's the sorting that kills you
> with large numbers of files.  If you don't care about showing them in
> order, '-f' is your friend.

I recommend adding the -1 (one) option if your ls will default to the -x
(horizontal) or -C (vertical) display formats (especially the vertical
format!). Otherwise ls will take some time to format the display.

Adam, I am happily managing well in excess of 800,000 small image files in
one gargantuan directory (ext3, Debian stock sarge 2.6.8 kernel) for a
relatively busy web site. As long as I don't foolishly type ls without the
-f, I'm fine (I usually use find at the start of a very long pipe anyway).

Did I say happily? No, that's not true. They should really be broken down
by how the application logically segments them. But it's inherited and the
design can't be changed (for a while).

-- 
Andrew B. Sweger -- The great thing about multitasking is that several
                                things can go wrong at once.



More information about the linux-list mailing list