From: Rich Freeman <rich0@gentoo.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Controlling emerges
Date: Mon, 18 Sep 2023 14:49:09 -0400 [thread overview]
Message-ID: <CAGfcS_=HS4Pun7r1QeqnrPebiyeGsijPiTsd-FKXvNJjTLO2QQ@mail.gmail.com> (raw)
In-Reply-To: <CAEdtorbygNjR5Xa87Q4ZuoE1Tf8cN=+eqV+gHt5Urxzp8ifVqg@mail.gmail.com>
On Mon, Sep 18, 2023 at 12:13 PM Alan McKinnon <alan.mckinnon@gmail.com> wrote:
>
> Whether you just let emerge do it's thing or try get it to do big packages on their own, everything is still going to use the same number of cpu cycles overall and you will save nothing.
That is true of CPU, but not RAM. The problem with large parallel
builds is that for 95% of packages they're fine, and for a few
packages they'll eat up all the RAM in the system until the OOM killer
kicks in, or the system just goes into a swap storm (which can cause
panics with some less-than-perfect kernel drivers).
I'm not aware of any simple solutions. I do have some packages set to
just build with a small number of jobs, but that won't prevent other
packages from being built alongside them. Usually that is enough
though. It is just frustrating to watch a package take all day to
build because I can't use more than -j2 or so without running out of
RAM, usually just at one step of the build process.
I can't see anybody bothering with this, but in theory packages could
have a variable to hint at the max RAM consumed per job, and the max
number of jobs it will run. Then the package manager could take the
lesser of -j and the max jobs the package can run, multiply it by the
RAM requirement, and compare that to available memory (or have a
setting to limit max RAM). Basically treat RAM as a resource and let
the package manager reduce -j to manage it if necessary.
Hmm, I guess a workaround would be to set ulimits on the portage user
so that emerge is killed before RAM use gets too out of hand. That
won't help complete builds, but it would at least keep it from killing
the system.
--
Rich
next prev parent reply other threads:[~2023-09-18 18:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 12:00 [gentoo-user] Controlling emerges Peter Humphrey
2023-09-18 12:59 ` Jack
2023-09-18 13:44 ` Peter Humphrey
2023-09-18 13:48 ` Alan McKinnon
2023-09-18 16:03 ` Peter Humphrey
2023-09-18 16:13 ` Alan McKinnon
2023-09-18 17:54 ` Laurence Perkins
2023-09-18 22:44 ` William Kenworthy
2023-09-19 9:09 ` Peter Humphrey
2023-09-19 9:14 ` William Kenworthy
2023-09-19 9:37 ` Andreas Fink
2023-09-19 9:48 ` Peter Humphrey
2023-09-19 10:06 ` Rich Freeman
2023-09-19 10:13 ` William KENWORTHY
2023-09-18 17:59 ` Michael
2023-09-18 18:10 ` John Blinka
2023-09-18 18:18 ` Dale
2023-09-18 18:49 ` Rich Freeman [this message]
2023-09-19 12:28 ` Peter Humphrey
2023-09-20 22:06 ` Wol
2023-09-21 19:26 ` Laurence Perkins
2023-09-21 20:30 ` Tsukasa Mcp_Reznor
2023-09-22 1:13 ` Dale
2023-09-22 7:13 ` Michael
2023-09-22 10:07 ` Rich Freeman
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='CAGfcS_=HS4Pun7r1QeqnrPebiyeGsijPiTsd-FKXvNJjTLO2QQ@mail.gmail.com' \
--to=rich0@gentoo.org \
--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