On 2020-07-12 11:29+0300 Nikos Chantziaras <[email protected]> wrote:
> On 12/07/2020 09:04, William Kenworthy wrote:
> > Hi,
> >
> > is there a way to change the MAKEOPTS setting on a running
> > emerge? I am using "-j 5 -l 4" whilst emerging gcc-9.3 but its
> > creating too much pressure on memory. I expect the emerge to take
> > many more hours but complete eventually - but reducing it to "-j2"
> > will help other operations whilst not losing whats already been
> > completed (this is an old atom N330 with 4G ram and is my
> > gateway/router/firewall/snort/... and the overload is starting to
> > affect the network throughput significantly).
>
> […]
> ionice is in sys-apps/util-linux, so it's probably already installed.
> schedtool though is in sys-process/schedtool and it might not be
> installed.
> […]
The nice level can also be adjusted with `renice` from
sys-apps/util-linux:
renice -n 19 -p pid
> Another thing I recommend is getting rid of "-j5". Use -j4. The "+1"
> recommendation from decades ago does not apply anymore with modern
> Linux kernels. You can test this yourself by emerging a smaller
> package that takes like 2 minutes or so to emerge, and compare times
> with j4 and j5. Most likely you will see no difference, other than j5
> using more RAM.
You can also set MAKEOPTS and other Portage variables per package, for
example:
echo 'MAKEOPTS="-j1"' >> /etc/portage/env/onejob.conf
echo 'sys-devel/gcc onejob.conf' >> /etc/portage/package.env/onejob
See <https://wiki.gentoo.org/wiki//etc/portage/package.env> for more
information.