Gentoo Archives: gentoo-portage-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] exclude cache from sync, was:Cache rewrite backport
Date: Thu, 13 Oct 2005 17:48:13
Message-Id: 20051013174711.GD21343@nightcrawler
In Reply to: [gentoo-portage-dev] exclude cache from sync, was:Cache rewrite backport by "Francesco R."
1 On Thu, Oct 13, 2005 at 07:12:42PM +0200, Francesco R. wrote:
2 > Elaborating on the previous subject an idea come in mind,
3 > avoid the $PORTDIR/metadata/cache sync, It's 80 MB, 20000 files
4 >
5 > So I've tryed the first python patch of my life, obviously it's also the
6 > first portage one (subliminal message, take the result with care and
7 > check it yourself)
8 >
9 > how? the patch add the option "--withregen", the to
10 > exclude /metadata/cache from the sync and to issue a regen of the cache
11 > before to update the metadata.
12 > calling "emerge --withregen --sync" do the work.
13 >
14 > The following test has run with a dual opteron as rsync server and a
15 > Athlon XP 2500+ with an old and slow disk, cabled with gigabit
16 > ethernet. The rsync is forced removing the timestamp.
17 >
18 > The portage tree has been synced _before_ starting the bench, so the
19 > overhead of rsync is really reduced at the bare minimum, check the
20 > differences between the files on server and client.
21 >
22 > The surprising result is that recreating the cache is faster than rsync
23 > it. (real time)
24 Nuke the cache and try it ;)
25 Being slightly sarcastic there, fastest I've managed to get a
26 full regen down to was around 22 minutes for ebd, with stable being
27 around 34m
28 http://dev.gentoo.org/~ferringb/ebuild-daemon/stats/paired-stats
29
30 I'd expect the gap has narrowed a bit since those timing runs,
31 although it should still be sizable. Either way, the longer timing
32 run (stable ebuild.sh) is the one to note :)
33
34 So... that --metadata run has an extra stat call per check best case,
35 but the cost of getting a cache entry is pretty heavily different.
36 For metadata, just is a file read/write, for regen, exec(bash -c
37 ebuild.sh) which, via quicky commandline test (that sets a floor for
38 it), time bash /usr/lib/portage/bin/ebuild.sh , you're looking at
39 around .1s per call.
40
41 Pretty heavy difference on updates, eg, worst case- something a user
42 hits on first sync, or nuking of the tree :)
43
44 > ===================================|===================================
45 > ===================================|===================================
46 > 1st try, portage [2.0.53_rc5] + cac|1st try, portage [2.0.53_rc5] + cac
47 > ===================================|===================================
48 > sync with cache and _no_ regen |sync without cache and regen after
49 > |Regenerating cache entries...
50 > |done regen!
51 > |
52 > real 6m23.727s |real 4m14.837s
53 > user 0m12.373s |user 0m18.681s
54 > sys 0m13.849s |sys 0m7.744s
55 > ===================================|===================================
56 > ===================================|===================================
57 > 2nd try, portage [2.0.53_rc5] + cac|2nd try, portage [2.0.53_rc5] + cac
58 > ===================================|===================================
59 > sync with cache and _no_ regen |sync without cache and regen after
60 > |Regenerating cache entries...
61 > |done regen!
62 > |
63 > real 6m53.649s |real 2m40.794s
64 > user 0m12.361s |user 0m18.361s
65 > sys 0m14.117s |sys 0m6.800s
66 > ===================================|===================================
67 > ===================================|===================================
68 > 3rd try, portage [2.0.53_rc5] + cac|3rd try, portage [2.0.53_rc5] + cac
69 > ===================================|===================================
70 > sync with cache and _no_ regen |sync without cache and regen after
71 > |Regenerating cache entries...
72 > |done regen!
73 > |
74 > real 6m46.973s |real 4m19.261s
75 > user 0m12.605s |user 0m18.593s
76 > sys 0m13.733s |sys 0m7.648s
77 > |
78
79 That said, I'm curious wth is triggering the 2x sys activity, which
80 probably is to blame for the ~90s difference
81
82 Anyone game for profiling a --metadata run, vs --regen run via
83 profile.run?
84 ~harring