public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Waldo Lemmer <pugonfireyt@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] nproc
Date: Tue, 4 Jun 2024 19:20:30 +0200	[thread overview]
Message-ID: <CAAEVSTGhE=OA4v8X-zpTP0MQ8tyf6-YwEZO=_k+R-UQPsdBH7Q@mail.gmail.com> (raw)
In-Reply-To: <77e41247-3c97-caf7-5009-f31b17ab3341@panix.com>

[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]

Hi Jude,

I can't answer your question directly because, frankly, it doesn't make a
whole lot of sense. But I'll try my best to clear things up for you.

The `nproc` command prints how many processors (CPU cores) are available
for applications to use. This is how many emerge or make jobs can run in
parallel.

How many jobs actually run depends on the -j and -l values of both emerge
and make. emerge's -j and -l are passed on the command line or in
EMERGE_DEFAULT_OPTS in make.conf. make's -j and -l are passed in MAKEOPTS
in make.conf.

The following links cover the ideal values for these:

https://wiki.gentoo.org/wiki/EMERGE_DEFAULT_OPTS
https://wiki.gentoo.org/wiki/MAKEOPTS

As for my recommendation, I would go for the following (assuming nproc
outputs '8'):

    MAKEOPTS='--jobs=8 --load-average=8'
    EMERGE_DEFAULT_OPTS='--jobs=8'

Note that I didn't pass -l to emerge. I don't want to risk confusing you
further, so I won't explain my reasoning here. Anyone who's interested
should feel free to ask.

There has been a lot of discussion about the perfect values, with no real
consensus having been reached:

 - make -j8 -l8, emerge -j8,

 - make -j8 -l8, emerge -j8 -l8,

 - make -j8 -l9, emerge -j8 -l8,

 - make -j9 -l7, emerge -j9 -l7, etc.

My advice is to pick whatever feels right to you, and use genlop to measure
the differences if you really care about getting it exactly right. I'm
willing to bet you won't see more than 10% difference between the above
combinations for most runs of emerge.

I hope I've managed to identify and address your misunderstandings.

Waldo

On Tue, Jun 4, 2024, 18:20 Jude DaShiell <jdashiel@panix.com> wrote:

> How is the number of threads nproc can handle printed out to the terminal?
> On an earlier install try I had J7,l8 put in /etc/portage/make.conf since
> the computer has 14gb of available memory on it.
>
>
> --
>  Jude <jdashiel at panix dot com>
>  "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo.
>  Please use in that order."
>  Ed Howdershelt 1940.
>
>

[-- Attachment #2: Type: text/html, Size: 3355 bytes --]

      parent reply	other threads:[~2024-06-04 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 16:17 [gentoo-user] nproc Jude DaShiell
2024-06-04 16:22 ` Jude DaShiell
2024-06-04 17:20 ` Waldo Lemmer [this message]

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='CAAEVSTGhE=OA4v8X-zpTP0MQ8tyf6-YwEZO=_k+R-UQPsdBH7Q@mail.gmail.com' \
    --to=pugonfireyt@gmail.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