On Sat, May 24, 2008 at 04:49:09PM -0500, Penguin Lover [EMAIL PROTECTED] squawked: > Is there any way to speed up the du command? I mean short of having > cron run it on target directories and store results. (not really > speeding up but at least not having to wait for a result) > > I've seen various mention of du being slow but don't recall any > mentions of how to speed it up. > > I use Reiserfs with default sizes. In some situations like a large > cache of nntp messages of several GB. I might wait 5-10 minutes or more > for du to get the size of the directory. > > Are there other file systems that can return a result of `du' faster? > > I'm curious how `df' computes sizes so much quicker. Even after > rm'ing a large amount of data... `df' sees the difference right away. > > Or maybe there is some other tool or technique that can quickly tell > me the size of a directory or set of directories.
I am pretty sure the problem with du is that it actually looks, recursively, at every single file and computes the size that way. So the time you have to wait is mostly due to disk IO (and caching would also explain why if you run du twice in a row the answer returns much more quickly). So, if you know what the bottle-neck directory is (for example, the directory of nntp messages), the tricks in http://gentoo-wiki.com/TIP_Speeding_up_portage should probably work just as well. HTH, W -- "You're very sure of your facts, " he said at last, "I couldn't trust the thinking of a man who takes the Universe - if there is one - for granted. " Sortir en Pantoufles: up 533 days, 21:55 -- [email protected] mailing list

