Gentoo Archives: gentoo-user

From: Allan Gottlieb <gottlieb@×××.edu>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Speed up `du'
Date: Sat, 24 May 2008 22:22:45
Message-Id: yu97idjtk9e.fsf@nyu.edu
In Reply to: [gentoo-user] Speed up `du' by reader@newsguy.com
1 At Sat, 24 May 2008 16:49:09 -0500 reader@×××××××.com wrote:
2
3 > Is there any way to speed up the du command? I mean short of having
4 > cron run it on target directories and store results. (not really
5 > speeding up but at least not having to wait for a result)
6 >
7 > I've seen various mention of du being slow but don't recall any
8 > mentions of how to speed it up.
9 >
10 > I use Reiserfs with default sizes. In some situations like a large
11 > cache of nntp messages of several GB. I might wait 5-10 minutes or more
12 > for du to get the size of the directory.
13 >
14 > Are there other file systems that can return a result of `du' faster?
15 >
16 > I'm curious how `df' computes sizes so much quicker. Even after
17 > rm'ing a large amount of data... `df' sees the difference right away.
18
19 I can't help with speeding up du, but can explain df's speed.
20 This information is kept in the superblock. Each operation that
21 changes size updates the superblock and df just reads the result.
22 (In a sense it is like your cron soln above for du :-) .)
23
24 > Or maybe there is some other tool or technique that can quickly tell
25 > me the size of a directory or set of directories.
26
27 allan
28 --
29 gentoo-user@l.g.o mailing list