public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Peter Humphrey <peter@prh.myzen.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] long compiles
Date: Thu, 14 Sep 2023 10:49:35 +0100	[thread overview]
Message-ID: <3264216.44csPzL39Z@wstn> (raw)
In-Reply-To: <3442789.QJadu78ljV@rogueboard>

On Wednesday, 13 September 2023 16:14:09 BST Michael wrote:

> 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.

Yes, I understand that, but I've spent a lot of time watching, and 
instrumenting, and in practice the load doesn't exceed about 33.

> The --load-average=32 is normally expected to be a floating point number

That stipulation has only appeared recently. I have tried adding a '.0' to the 
number, and it's made no noticeaible difference. Besides, I could attempt 
pedantry and declare that the set of all integers is a proper subset of all 
real numbers.  ;-)

> 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.

I have actually had three or four big packages running together, but my 
observation is that they don't pump the load up too far.

> 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.  ;-)

Yes, that's what we need, all right.

> 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.

That is the difficulty. I do often rebuild a new system, not trusting the 
existing one any longer, and a lot of time is spent fiddling with four tiny 
packages at a time in the early and middle stages, then benefitting from the 
limit of 4 once the desktop packages begin.

> 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.

Interesting. Do you mean 95% of the jobs figure? I'll do some more 
experimenting.

Meanwhile, perhaps I'll run new builds in two stages: the first without any 
desktop packages - I do have sets defined to enable that - and the second with 
them. I can't do that with emerge -e though.

-- 
Regards,
Peter.





  reply	other threads:[~2023-09-14  9:49 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
2023-09-14  9:49               ` Peter Humphrey [this message]
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=3264216.44csPzL39Z@wstn \
    --to=peter@prh.myzen.co.uk \
    --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