From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,1ec31da3fc1981bc X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2004-03-03 23:57:26 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: paltskallen@hotmail.com (Fredrik) Newsgroups: comp.unix.tru64 Subject: Re: No of files in a directory (performance) Date: 3 Mar 2004 23:57:26 -0800 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 195.84.30.66 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1078387046 25752 127.0.0.1 (4 Mar 2004 07:57:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 4 Mar 2004 07:57:26 +0000 (UTC) Xref: archiver1.google.com comp.unix.tru64:11271 I did rm -rf first_directory_to_remove so I think -rf are doing som wierd stuff... Bob Harris wrote in message news:... > In article , > paltskallen@hotmail.com (Fredrik) wrote: > > > OK. > > > > I have noticed that rm -rf on a dir takes way longer on a dir with > > many files in it, ex if there are 10k files it takes 10 sec, but with > > 70k files it takes 150 sec. > > > > find|xargs rm > > takes the same time (per file that is). It seems that -rf does some > > magic that slows it down. > > > > > > Bob Harris wrote in message > > news:... > > > In article , > > > paltskallen@hotmail.com (Fredrik) wrote: > > > > > > > Hello! > > > > > > > > We have an application that creates and reads a lot of files. > > > > These files are splitted on 100 dirs. Currently there are ~70 000 files > > > > in > > > > each dir. > > > > Are there any limit that should be considered regarding to performance > > > > issues?? > > > > > > > > Using advfs and san disks. > > > > > > AdvFS in Tru64 UNIX v5.0 or later uses b-tree indexing for directory > > > access. While a huge directory does take slightly longer to create, > > > lookup, delete a file, it is _NOT_ linear. The performance is really > > > very good. > > > > > > However, if you ask 'ls' to display all the files it will take a long > > > time to fetch all the files, then sort them, and then display them, but > > > if you use 'ls -f' it skips the sorting, which can make things faster. > > > > > > Bob Harris > > Did you do > > rm -rf * > > or > > rm -rf first_directory_to_remove > > If the first, then the shell you are using will first collect all the > file names, then sort them, then substitute them on the command line, > then it will invoke rm. > > The find command doesn't sort anything. > > If you did the 2nd example, then it must be something in rm, as the file > system doesn't really know know what command is being used to delete > something. > > Bob Harris