* No of files in a directory (performance)
@ 2004-02-27 9:29 Fredrik
2004-02-27 9:38 ` TyBreaker
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Fredrik @ 2004-02-27 9:29 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: No of files in a directory (performance) 2004-02-27 9:29 No of files in a directory (performance) Fredrik @ 2004-02-27 9:38 ` TyBreaker 2004-02-27 17:17 ` Peter da Silva 2004-02-28 1:41 ` Bob Harris 2 siblings, 0 replies; 7+ messages in thread From: TyBreaker @ 2004-02-27 9:38 UTC (permalink / raw) 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. I have found problems going too far beyond 1024 files per dir when it comes to use * wildcard with the directory contents. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: No of files in a directory (performance) 2004-02-27 9:29 No of files in a directory (performance) Fredrik 2004-02-27 9:38 ` TyBreaker @ 2004-02-27 17:17 ` Peter da Silva 2004-02-28 1:41 ` Bob Harris 2 siblings, 0 replies; 7+ messages in thread From: Peter da Silva @ 2004-02-27 17:17 UTC (permalink / raw) In article <ff81d3b0.0402270129.205a3e@posting.google.com>, Fredrik <paltskallen@hotmail.com> wrote: > These files are splitted on 100 dirs. Currently there are ~70 000 files > in each dir. Name lookup is a linear search. You are likely to see performance problems with this. I recommend adding two more directory levels. -- I've seen things you people can't imagine. Chimneysweeps on fire over the roofs of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All these things will be lost in time, like chalk-paintings in the rain. `-_-' Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U` ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: No of files in a directory (performance) 2004-02-27 9:29 No of files in a directory (performance) Fredrik 2004-02-27 9:38 ` TyBreaker 2004-02-27 17:17 ` Peter da Silva @ 2004-02-28 1:41 ` Bob Harris 2004-03-03 15:26 ` Fredrik 2 siblings, 1 reply; 7+ messages in thread From: Bob Harris @ 2004-02-28 1:41 UTC (permalink / raw) In article <ff81d3b0.0402270129.205a3e@posting.google.com>, 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: No of files in a directory (performance) 2004-02-28 1:41 ` Bob Harris @ 2004-03-03 15:26 ` Fredrik 2004-03-03 16:03 ` Bob Harris 0 siblings, 1 reply; 7+ messages in thread From: Fredrik @ 2004-03-03 15:26 UTC (permalink / raw) 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 <harris@zk3.dec.com> wrote in message news:<harris-8A4C82.20384627022004@cacnews.cac.cpqcorp.net>... > In article <ff81d3b0.0402270129.205a3e@posting.google.com>, > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: No of files in a directory (performance) 2004-03-03 15:26 ` Fredrik @ 2004-03-03 16:03 ` Bob Harris 2004-03-04 7:57 ` Fredrik 0 siblings, 1 reply; 7+ messages in thread From: Bob Harris @ 2004-03-03 16:03 UTC (permalink / raw) In article <ff81d3b0.0403030726.38e36a24@posting.google.com>, 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 <harris@zk3.dec.com> wrote in message > news:<harris-8A4C82.20384627022004@cacnews.cac.cpqcorp.net>... > > In article <ff81d3b0.0402270129.205a3e@posting.google.com>, > > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: No of files in a directory (performance) 2004-03-03 16:03 ` Bob Harris @ 2004-03-04 7:57 ` Fredrik 0 siblings, 0 replies; 7+ messages in thread From: Fredrik @ 2004-03-04 7:57 UTC (permalink / raw) I did rm -rf first_directory_to_remove so I think -rf are doing som wierd stuff... Bob Harris <harris@zk3.dec.com> wrote in message news:<harris-8A1069.10595103032004@juggl7.zk3.dec.com>... > In article <ff81d3b0.0403030726.38e36a24@posting.google.com>, > 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 <harris@zk3.dec.com> wrote in message > > news:<harris-8A4C82.20384627022004@cacnews.cac.cpqcorp.net>... > > > In article <ff81d3b0.0402270129.205a3e@posting.google.com>, > > > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-03-04 7:57 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-02-27 9:29 No of files in a directory (performance) Fredrik 2004-02-27 9:38 ` TyBreaker 2004-02-27 17:17 ` Peter da Silva 2004-02-28 1:41 ` Bob Harris 2004-03-03 15:26 ` Fredrik 2004-03-03 16:03 ` Bob Harris 2004-03-04 7:57 ` Fredrik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox