From: Michael <confabulate@kintzios.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] long compiles
Date: Wed, 13 Sep 2023 16:14:09 +0100 [thread overview]
Message-ID: <3442789.QJadu78ljV@rogueboard> (raw)
In-Reply-To: <4852301.GXAFRqVoOG@wstn>
[-- Attachment #1: Type: text/plain, Size: 3026 bytes --]
On Wednesday, 13 September 2023 13:41:00 BST Peter Humphrey wrote:
> On Wednesday, 13 September 2023 12:50:20 BST Wols Lists wrote:
> > On 13/09/2023 12:28, Peter Humphrey wrote:
> > > A thought on compiling, which I hope some devs will read: I was tempted
> > > to
> > > push the system hard at first, with load average and jobs as high as I
> > > thought I could set them. I've come to believe, though, that job control
> > > by portage and /usr/bin/make is weak at very high loads, because I would
> > > usually find that a few packages had failed to compile; also that some
> > > complex programs were sometimes unstable. Therefore I've had to throttle
> > > the system to be sure(r) of correctness. Seems a waste.
> >
> > Bear in mind a lot of systems are thermally limited and can't run at
> > full pelt anyway ...
>
> No doubt, but apparently not this box: I run it 24x7 with all 24 CPU threads
> fully loaded with floating-point calculations, which make a good deal more
> heat than 'mere' compiling with (I assume) integer arithmetic. :)
I recall this being discussed in a previous thread, but if your CPU has 24
threads and you've set:
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=32
MAKEOPTS="-j14"
You will be asking emerge to run up to 4 x 14 = 56 threads, which could
potentially eat up to 2G of RAM each, i.e. 112G of RAM. This will exhaust
your 64G of RAM, not taking into account whatever else the OS will be trying
to run at the time. The --load-average=32 is normally expected to be a
floating point number indicating a percentage of load x the number of cores;
e.g. for 12 cores you could set it at 12 x 0.9 = 10.8 to limit the load to 90%
so as maintain some system responsiveness.
Of course, not all emerges use make and you may never or rarely emerge 4 x
monster packages in parallel to need 2G of RAM for each thread at the same
time.
If only we had at our disposal some AI algorithm to calculate dynamically each
time we run emerge the optimal combo of parallel emerge jobs and number of
make tasks, so as to achieve the highest total time saving Vs energy spent!
Or just the highest total time saving. ;-)
I haven't performed any meaningful comparisons to determine where the greatest
gains are to be achieved. Parallel emerges of many small packages, or a large
number of make jobs for big packages. The combination would change each time
according to the individual packages waiting for an update. In my use case,
instinctively feels more beneficial reducing the time I have to wait for huge
packages like qtwebengine to finish, than accelerating the updates of half a
dozen smaller packages. Therefore, as a rule I leave EMERGE_DEFAULT_OPTS
unset. I set MAKEOPTS jobs to the number of CPU threads +1 and the load
average at 95%, so I can continue using the PC without any noticeable latency.
On PCs where RAM is constrained I reduce the MAKEOPTS in /etc/portage/
package.env for any large packages which are bound to start swapping and
thrashing the disk.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-09-13 15:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 19:19 [gentoo-user] long compiles Alan McKinnon
2023-09-11 19:31 ` Dale
2023-09-11 19:33 ` Siddhanth Rathod
2023-09-11 19:46 ` Alan McKinnon
2023-09-12 21:08 ` Wol
2023-09-13 11:28 ` Peter Humphrey
2023-09-13 11:50 ` Wols Lists
2023-09-13 12:38 ` Frank Steinmetzger
2023-09-13 12:41 ` Peter Humphrey
2023-09-13 15:14 ` Michael [this message]
2023-09-14 9:49 ` Peter Humphrey
2023-09-14 12:24 ` Michael
2023-09-11 19:42 ` Ramon Fischer
2023-09-11 19:46 ` Ramon Fischer
2023-09-11 20:05 ` Neil Bothwick
2023-09-11 20:21 ` Alan McKinnon
2023-09-11 21:22 ` Michael
2023-09-11 21:46 ` Alan McKinnon
2023-09-11 23:04 ` Ramon Fischer
2023-09-12 8:57 ` Alan McKinnon
2023-09-12 10:14 ` Peter Humphrey
2023-09-12 10:57 ` Jacques Montier
2023-09-12 9:26 ` [gentoo-user] " Nikos Chantziaras
2023-09-12 9:19 ` Nikos Chantziaras
2023-09-12 19:01 ` Alan McKinnon
2023-09-12 19:30 ` Nuno Silva
2023-09-12 22:11 ` Neil Bothwick
2023-09-13 21:15 ` [gentoo-user] " Kristian Poul Herkild
2023-09-13 21:20 ` [gentoo-user] " Grant Edwards
2023-09-13 21:37 ` Neil Bothwick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3442789.QJadu78ljV@rogueboard \
--to=confabulate@kintzios.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox