Different cpu workloads for the same process building a package from AUR

Right before I start, I say sorry. I know It’s a little off topic, but didn’t find a better place for my question. Second, I know, I shouldn’t have done that, but I used pamac with sudo.

I did that to install amarok, which didn’t work either with yay nor with pamac, but worked just fine using pamac with sudo.

I had htop running while building the package and installing it. I like to do that, just for getting to know my stuff better. At least I am still learning Linux an IT in general. I watched the CPU workload and witnessed the following: When I tried to install amarok with yay or pamac without sudo, all 14 cores (all 20 threads) were at 100% all the time. When I used sudo pamac all cores were at less then 5% permanently. I repeated the whole thing several times. Allways the same. Can anyone explain that to me?

Greetings from Lingen, Germany
Timo

See: man makepkg.conf

Check:

  • grep "MAKEFLAGS" /etc/makepkg.conf
  • grep "MAKEFLAGS" $HOME/.makepkg.conf
1 Like
(base) [timok@VivoLinux ~]$ grep "MAKEFLAGS" /etc/makepkg.conf
MAKEFLAGS="-j2"
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
(base) [timok@VivoLinux ~]$ grep "MAKEFLAGS" $HOME/.makepkg.conf
MAKEFLAGS="-j$(($(nproc)+1))"
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,

I have no idea, what that means… :thinking:

Don’t do that. Pamac will prompt for authentication when required.

:point_down:

:point_down:

See the difference? :wink:

See makepkg - ArchWiki

Then why did you create $HOME/.makepkg.conf with those changes?

3 Likes

You are telling the compiler to use one more processor core than what you actually have
with:

This is even often recommended, but also can lead to failures - as you learned.

Use a lower, safer number (like the default MAKEFLAGS="-j2")
or give it the number of actual cores that your processor has got as a maximum.
That lower number will not saturate the processor cores but of course will make the compilation take longer.

1 Like

Thanks for the explanations. Now I see…

FWIW I use minus 2

MAKEFLAGS="-j$(($(nproc)-2))"
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.