Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] speedup remote portage William Kenworthy <billk@×××××××××.au>