On 2/24/2010 4:11 PM, Stefan Walk wrote:

On 24 Feb 2010, at 22:57, David Dyer-Bennet wrote:


On Wed, February 24, 2010 14:39, Nicolas Williams wrote:
On Wed, Feb 24, 2010 at 02:09:42PM -0600, Bob Friesenhahn wrote:
I have a directory here containing a million files and it has not
caused any strain for zfs at all although it can cause considerable
stress on applications.

The biggest problem is always the apps.  For example, ls by default
sorts, and if you're using a locale with a non-trivial collation (e.g.,
any UTF-8 locales) then the sort gets very expensive.

Which is bad enough if you say "ls". And there's no option to say "don't
sort" that I know of, either.

If you say "ls *" it's in some ways worse, in that the "*" is expanded by
the shell, and most of the filenames don't make it to ls at all.  ("ls
abc*" is more likely, but with a million files that can still easily
overlow the argument limit.)

There really ought to be an option to make ls not sort, at least.

ls -f?

The man page sure doesn't sound like it:

    -f         Forces each  argument  to  be  interpreted  as  a
                directory  and  list the name found in each slot.
                This option turns off -l, -t, -s, -S, and -r, and
                turns  on  -a.  The  order  is the order in which
                entries appear in the directory.

And it doesn't look like it plays well with others.

Playing with it, it does look like it works for listing all the files in one directory without sorting, though, so yes, that's a useful solution to the problem. (Yikes what an awful description in the man pages!)

--
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to