Gentoo Archives: gentoo-user

From: Volker Armin Hemmann <volkerarmin@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] slocate masked
Date: Wed, 17 Nov 2010 20:59:04
Message-Id: 201011172158.11859.volkerarmin@googlemail.com
In Reply to: Re: [gentoo-user] slocate masked by Mick
1 On Wednesday 17 November 2010, Mick wrote:
2 > On Wednesday 17 November 2010 20:10:54 Yohan Pereira wrote:
3 > > On Thursday 18 Nov 2010 1:17:09 am Alan McKinnon wrote:
4 > > > Let's compare then. My system is 4 minutes to re-index everything from
5 > > > scratch. How long does your take and how big is your filesystem?
6 > >
7 > > time updatedb
8 > > real 1m35.163s
9 > > user 0m0.815s
10 > > sys 0m2.454s
11 > >
12 > > this was the first time i ran it after installation. i had uinstalled
13 > > slocate prior to this.
14 > >
15 > > PRUNEPATHS="/tmp /var/tmp /root/.ccache /media/stuff/backup/gentoo32"
16 > >
17 > > the last folder is my 32bit chroot.
18 > > and i got arround 225 gb of data. i tried running a few qurries .. seems
19 > > to have indexed everything
20 > >
21 > > also after this i tried deleting /var/lib/mlocate/mlocate.db and then
22 > > running updatedb and it hardly took a second.
23 > >
24 > > time updatedb
25 > >
26 > > real 0m0.367s
27 > > user 0m0.193s
28 > > sys 0m0.167s
29 > >
30 > > weird indeed.
31 >
32 > I can't be doing this right ...
33 >
34 > I removed /var/lib/mlocate/mlocate.db, the ran updatebd:
35 >
36 > # time -p updatedb
37 > real 113.22
38 > user 0.62
39 > sys 8.00
40 >
41 > Then removed it again and run it again:
42 >
43 > # time updatedb
44 >
45 > real 0m1.063s
46 > user 0m0.162s
47 > sys 0m0.896s
48 >
49 > Why is the second time so much faster? The size of the derived db was the
50 > same on both occasions.
51
52 first run:
53
54 updatedb -v 6,76s user 39,99s system 7% cpu 10:35,80 total
55
56 yeah, see, the 'total' thing is the meaningfull one.
57
58 But lets have a look what was indexed:
59
60 df -h
61 Dateisystem Size Used Avail Use% Eingehängt auf
62 rootfs 57G 34G 23G 60% /
63 devtmpfs 3,9G 344K 3,9G 1% /dev
64 rc-svcdir 1,0M 120K 904K 12% /lib64/rc/init.d
65 shm 4,0G 232K 4,0G 1% /dev/shm
66 tmpfs 8,0G 12K 8,0G 1% /var/tmp/portage
67 tmpfs 1,0G 5,4M 1019M 1% /tmp
68 /dev/md3 765G 606G 160G 80% /mnt/data
69 /dev/md5 753G 558G 195G 75% /mnt/4chan
70
71 beware: /mnt/4chan should be named '/mnt/first_line_of_defense' because it is
72 the first backup stage. Named for historical reasons (aka I am too lazy to
73 rename.
74 To index an fs you don't have to go all over it. You just have the fs to dump
75 all the file names on you. And that can be very fast.