Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] slocate masked
Date: Wed, 17 Nov 2010 21:01:02
Message-Id: AANLkTi==Mw4kuH8AvfR2F=sEB05ydM6ykVxwZ9SMCG0A@mail.gmail.com
In Reply to: Re: [gentoo-user] slocate masked by Mick
1 On Wed, Nov 17, 2010 at 2:35 PM, Mick <michaelkintzios@×××××.com> 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 to
19 >> 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 I guess caching like Volker said too. What happens if you do something
53 like this twice:
54
55 sync; sh -c "echo 3 > /proc/sys/vm/drop_caches"; time updatedb

Replies

Subject Author
Re: [gentoo-user] slocate masked Alan McKinnon <alan.mckinnon@×××××.com>