Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Jobs and load-average
Date: Wed, 15 Feb 2023 13:12:48
Message-Id: 22969972.6Emhk5qWAg@lenovo.localdomain
In Reply to: Re: [gentoo-user] Jobs and load-average by "Peter Böhm"
1 On Wednesday, 15 February 2023 11:31:49 GMT Peter Böhm wrote:
2 > Am Mittwoch, 15. Februar 2023, 10:56:22 CET schrieb Peter Humphrey:
3 > > Hello list,
4 > >
5 > > Not long ago I read that we should allow 2GB RAM for every emerge job -
6 > > that is, we should divide our RAM size by 2 to get the maximum number of
7 > > simultaneous jobs. I'm trying to get that right, but I'm not there yet.
8 > >
9 > > I have these entries in make.conf:
10 > > EMERGE_DEFAULT_OPTS="--jobs=16 --load-average=32 --autounmask=n --quiet-
11 > > unmerge-warn --ke>
12
13 The above determine how may ebuilds will be emerged in parallel. If you are
14 rebuilding your whole system with hundreds of packages stacking up to be
15 emerged, then having as high as 16 packages being emerged in parallel could be
16 advantageous.
17
18
19 > > MAKEOPTS="-j16"
20
21 This determines how many MAKE jobs will run in parallel in any one emerge.
22 Large packages like chromium will benefit from maximising the number of jobs
23 here, as long as you have enough RAM.
24
25 Given you have 24 threads and your RAM is 64GB, you should be able to ratchet
26 this up to -j24, but not if you specify a high EMERGE_DEFAULT_OPTS at the same
27 time, or if the compiler is eating up more than 2G per process.
28
29
30 > > Today, though, I saw load averages going up to 72. Can anyone suggest
31 > > better values to suit my 24 threads and 64GB RAM?
32
33 Since you have specified up to 16 parallel emerges and each one could run up
34 to 16 MAKE jobs, you can understand why you would soon find loads escalating
35 and your machine becoming unresponsive.
36
37 You should consider what is more important for you, emerging as many packages
38 in parallel as possible, or emerging any one large package as fast as
39 possible.
40
41 Two extreme examples would be setting EMERGE_DEFAULT_OPTS at "--jobs 24", with
42 MAKEOPTS at "-j1", or conversely setting EMERGE_DEFAULT_OPTS at "--jobs 1",
43 with MAKEOPTS at "-j24".
44
45 On my old and slow laptop with only 4 threads and 16G of RAM my priority is to
46 finish large packages faster. I leave EMERGE_DEFAULT_OPTS unset, while
47 specifying MAKEOPTS="-j5 -l4.8". This uses a job number I determined by trial
48 and error, building ffmpeg repeatedly by progressively increasing the number
49 for -j from 1 to 12. The two faster times were achieved with -j5 and -j10,
50 which aligns with the old myth of using CPU+1.
51
52 Regarding RAM being used being ~2G per MAKE job, this fluctuates with
53 successive compiler versions. I have seen up to 3.4G of RAM per process,
54 while emerging chromium. For such huge packages which cause excessive
55 swapping, unresponsiveness and thrashing of disk, I limit the MAKEOPTS to 3 in
56 package.env.
57
58
59 > Maybe you are interested in this wiki article:
60 >
61 > https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Optimize_compile_times
62 >
63 > Regards,
64 > Peter
65
66 I'd start by reading the suggestions in this article first, which is a good
67 introduction to the concepts involved:
68
69 https://wiki.gentoo.org/wiki/MAKEOPTS

Attachments

File name MIME type
signature.asc application/pgp-signature