Gentoo Archives: gentoo-user

From: William Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] speedup remote portage
Date: Fri, 28 Feb 2020 05:23:16
Message-Id: cda872be-6f70-eb39-e040-8ae6c888372a@iinet.net.au
In Reply to: Re: [gentoo-user] speedup remote portage by Rich Freeman
1 Hi Rich, I will experiment with a local metadata - that seems like it
2 might give a worthwhile speedup (its currently about 910Mb so not too big)
3
4 Bill K.
5
6
7 On 28/2/20 3:44 am, Rich Freeman wrote:
8 > On Thu, Feb 27, 2020 at 2:27 PM james <garftd@×××××××.net> wrote:
9 >> On 2/26/20 7:08 PM, William Kenworthy wrote:
10 >>> Hi,
11 >>>
12 >>> ��� due to space considerations on my laptop I have moved portage onto a
13 >>> network share (moosfs, mfsmounted) - slower but works fine.� However,
14 >>> being a laptop trying to update/install when out and about is both very
15 >>> slow and network intensive through a vpn - again, it works but is even
16 >>> slower to the point of not always being practical
17 >>>
18 >>> Is there a way to localise/speedup portage scanning parts of the
19 >>> update/install process?
20 >>
21 >> A simpler, much less sophisticated update, what I do is
22 >> use emerge -f option to 'fetch only' option first. The selectively
23 >> update; or you can use a usb-3.1+ device for fast easy upgrades, due to
24 >> laptop limitations, but the communications data channel limitations
25 >> leave you at the mercy of the available wireless bandwidth characteristics.
26 > So, a few thoughts here:
27 >
28 > 1. Definitely make sure you're splitting out distfiles. Any new
29 > install does this already, but mixing up the tree and distfiles is
30 > mixing very different types of data with different requirements.
31 > 2. Consider whether you REALLY need to share all this stuff. The
32 > whole tree isn't THAT big, so it might be easier to just locally sync.
33 > If network bandwidth is an issue, consider setting up a local mirror
34 > so that you sync (and fetch distfiles) within your network when
35 > available, and then just sync directly from the internet when you're
36 > remote.
37 > 3. If you REALLY need that portage tree to be on the network,
38 > consider keeping just the metadata directory local. That can be
39 > generated on-demand or synced, but either way it needs to be updated
40 > anytime the repo itself is updated. Generally with rsync we
41 > distribute both together. I suspect that having local metadata will
42 > cut down on your network IO when you're doing dep resolution/etc.
43 > 4. Squashfs was mentioned. In theory that is a nice compact
44 > solution. In practice you might find it to be a pain to update since
45 > it is read-only. But you could update your network tree, then create
46 > a squashfs and stick that on your network, and then sync the squashfs
47 > file for local mounting.
48 >
49 > I'm not sure how well moosefs performs for this sort of thing in
50 > general. I personally use lizardfs to store large multimedia files
51 > and it works fine, but streaming multi-GB multimedia that ends up
52 > getting buffered is a very different access pattern than sourcing a
53 > bazillion ebuild scripts. I'd be interested in how you're liking
54 > moosefs for this sort of thing in general. For accessing tons of
55 > little files I think all your latencies matter, but in particular you
56 > want low latency to your master server as that is going to end up
57 > limiting every read/open you perform. You might be able to play with
58 > the cache settings on the client side, though at least in lizardfs
59 > I've found some of those to be buggy - they're generally passed as
60 > mount options.
61 >
62 > In the past I've had one main Gentoo box sync its repo from the web,
63 > and had other hosts in the LAN either bind-mount this (containers), or
64 > sync this over the network. Likewise I generally share my main host
65 > distfiles as a mirror which is preferentially used by all my other
66 > hosts - you don't get a 100% hit rate and the main host won't get a
67 > copy of missed files, but it probably cuts down on 80+% of the network
68 > fetching as long as the main host does its fetches before the other
69 > hosts do. If the main host lacks a distfile then the MIRRORS setting
70 > has a regular Gentoo mirror listed next.
71 >
72 > Honestly, unless you're running a completely private repo for whatever
73 > reason I would not try to go remotely mounting your repo over the
74 > internet from your moosefs server. I bet you could fetch anything
75 > needed faster from a regular internet mirror in that case, and if
76 > portage could use mirrors seamlessly over internet latencies chances
77 > are we'd all be doing that already. Pretty much every distro
78 > maintains a local repo on every host for this reason.
79 >